首页 新闻 会员 周边

火狐下不支持Response.Write

0
[已解决问题] 解决于 2012-03-17 08:50

我在火狐游览器中一般处理程序中Response.Write调用了父类的UPdateMsg函数
 Response.Write("<script>parent.UpdateMsg('" + newFileName + "','" + (sql) + "')</script>");
为什么不支持啊,在ie8,360都支持的,但在火狐下不支持,请问有什么解决方案啊,谢谢了。

问题补充: //检查是否选择文件 function UpdateMsg(newfilename, filename) { alert(filename + newfilename); //此函数用来提供给提交到的页面如upload.ashx输出js的回调,更新当前页面的信息 if (newfilename == "") { $("[Id$=mag]").get(0).src = "Image/fbz.jpg"; } else { $("[Id$=mag]").get(0).src = filename + newfilename; alert(filename + newfilename); $("[name$='hf']").val(newfilename); } } 这是前台js的函数 我在ff下回调了这个函数,里面我alert了一下,但是都不起作用,
rains的主页 rains | 小虾三级 | 园豆:860
提问于:2010-11-22 17:50
< >
分享
最佳答案
0

   Response.ContentType = "text/html";页面输出类型问题

rains | 小虾三级 |园豆:860 | 2012-03-17 08:50
其他回答(4)
0

Response.Write肯定是支持的,检查你的JS吧

artwl | 园豆:16736 (专家六级) | 2010-11-22 23:15
0

Response.Write是服务器端的方法,没有浏览器支持不支持的说法.

火狐执行没效果的话楼主可以给js打断点调试跟C#代码一样...

附上我的测试代码:

 

a.html

<html>
<head>
<meta http-equiv="Content-Type" 
content="text/html; charset=utf-8">
<title>a</title>
<script type="text/javascript">
function callInnerFn(elem){
elem.contentWindow.test();
}

function fnTest(){
alert(
"parent fn");
}
</script>
</head>
<body>
<iframe src="b.html" onload="callInnerFn(this);">
</iframe>
</body>
</html>

 

 

b.html

 

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<title>b</title>
<script type="text/javascript">
function test(){
document.write(
'fn in b!')
window.parent.alert(
"fn in a!");
}

window.onload
= function(){
window.parent.fnTest();
}
</script>
</head>
<body>
<p>this is b.</p>
</body>
</html>

 

三桂 | 园豆:3565 (老鸟四级) | 2010-11-23 00:06
0

执行看查看源代码,然后复制源代码到HTML用firefox打看,再用firebug调试。

Astar | 园豆:40805 (高人七级) | 2010-11-23 06:51
0

还是看你自己的代码吧。如果连这个也不支持的话,asp.net会这么流行?没人会使用的。

顾晓北 | 园豆:10844 (专家六级) | 2010-11-23 09:09
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册