本文介绍了Klugdy CF防止Javascript执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面有这个cf脚本,其中的javascript工作正常,即

a新窗口打开当我按点击我时,我使用网址调用它时

在浏览器中。


但是当我POST时当我点击点击我时,javascript窗口不会打开javascript窗口

.


当我在浏览器中写一些kludgy时发布到它导致

javascript不执行?


任何帮助表示赞赏。

Mike

< CFSETTING ENABLECFOUTPUTONLY =" YES">

< cfcontent type =" image / svg + xml">

< cfoutput>

< svg width =" 1024px"高度= QUOT; 626px"的onload = QUOT; initsvg(EVT)" viewBox =" 0 0 1024

626" preserveAspectRatio = QUOT;无" xmlns =" http://www.w3.org/2000/svg"

xmlns:xlink =" http://www.w3.org/1999/xlink">

< title> Graphic< / title>

< defs>

< script language =" JavaScript">

<![CDATA [

var svgObj;

函数initsvg(evt)

{

if(window.svgDocument == null)

{

svgDocument = evt.target.ownerDocument;

}

svgObj = svgDocument.documentElement;

}

函数goDetail()

{

var myurl =" ;" ;;

var detailwin = open(myurl," detail",

" toolbar = no,scrollbars = yes,width = 600,height = 500, de pendent = no,resizable = yes,t

op = 50,left = 50");

detailwin.focus();

}

]]>

< / script>

< / defs>

< g变换= QUOT;翻译(35177)" onclick =" goDetail();">

< text font-family =" Arial"字体大小= QUOT; 10" font-weight =" bold"

fill =" ## 000000">

点击我

< set attributeName =" ;填"属性类型= QUOT; CSS" to =" ## FF0000"

begin =" mouseover" end =" mouseout" />

< set attributeName =" fill"属性类型= QUOT; CSS" to =" ## FF0000"

begin =" mousedown" end =" mouseup" />

< / text>

< / g>

< / svg>

< / cfoutput>

< CFSETTING ENABLECFOUTPUTONLY =" No">

I have this cf script below where the javascript in it works perfectly i.e.
a new window opens when I press ''click me'' when I call it up using the url
in the browser.

But when I "POST" to it from another script the javascript window does not
open when I click "click me".

Is cf writing something kludgy to the browser when I post to it causing the
javascript not to execute??

Any help is appreciated.
Mike
<CFSETTING ENABLECFOUTPUTONLY="YES">
<cfcontent type="image/svg+xml">
<cfoutput>
<svg width="1024px" height="626px" onload="initsvg(evt)" viewBox="0 0 1024
626" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Graphic</title>
<defs>
<script language="JavaScript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocument == null )
{
svgDocument = evt.target.ownerDocument;
}
svgObj = svgDocument.documentElement;
}
function goDetail()
{
var myurl = "";
var detailwin = open( myurl, "detail",
"toolbar=no,scrollbars=yes,width=600,height=500,de pendent=no,resizable=yes,t
op=50,left=50");
detailwin.focus();
}
]]>
</script>
</defs>
<g transform="translate(35,177)" onclick="goDetail();">
<text font-family="Arial" font-size="10" font-weight="bold"
fill="##000000">
click me
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mouseover" end="mouseout"/>
<set attributeName="fill" attributeType="CSS" to="##FF0000"
begin="mousedown" end="mouseup"/>
</text>
</g>
</svg>
</cfoutput>
<CFSETTING ENABLECFOUTPUTONLY="No">

推荐答案




为了缩小问题范围,我尝试使用PERL做同样的事情。


可悲的是我得到了相同的结果。


那是:


当cgi脚本独立执行时,javascript可以运行。


当cgi脚本从同一个CF脚本''POSTED''时,

javascript不起作用。


Mike



In attempt to narrow down the problem I tried the same thing using PERL.

Sadly I get the same result.

That is:

When the cgi script executes standalone the javascript works.

When the cgi script is ''POSTED'' to from the same CF script the
javascript does not work.

Mike





如果你真的想缩小范围,请忘记所有服务器端的东西。

Th对于客户端脚本而言,唯一重要的是客户端

看到的内容。


当它工作时,请在客户端文档上执行查看源。

当它没有时,在客户端文档上做一个查看源。


看到差异?


-

-

~kaeli~

是否有可能完全偏袒?





If you really want to narrow it down, forget all the server-side stuff.
The only thing that matters for client-side script is what the client
sees.

When it works, do a view source on the client doc.
When it doesn''t, do a view source on the client doc.

See a difference?

--
--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace




如果你真的想缩小范围,忘记所有服务器端的东西。
客户端脚本唯一重要的是客户端
当它工作时,在客户端文档上做一个视图源。
当它没有时,在客户端文档上做一个视图源。

看到差异?



If you really want to narrow it down, forget all the server-side stuff.
The only thing that matters for client-side script is what the client
sees.

When it works, do a view source on the client doc.
When it doesn''t, do a view source on the client doc.

See a difference?




我根本没有看到任何差异.....



I don''t see a difference at all .....


这篇关于Klugdy CF防止Javascript执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 22:41