通过本文主要向大家介绍了js调用ashx,js ashx,ashx,ashx文件怎么打开,ashx是什么文件等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
public static void ResponseScript(string script)
{
HttpContext.Current.Response.Write("<script type=\"text/javascript\">\n//<![CDATA[\n");
HttpContext.Current.Response.Write( script );
HttpContext.Current.Response.Write("\n//]]>\n</script>\n");
}
}
</div>
在form.ashx中调用:
结果在360的新版6.0中,一直不起作用,只是输出了
//]]>
</script>
</div>
但在IE中显示又完全正常。
后来发现,原来360浏览器的极速模式调用的是Google浏览器的Chrome内核,所以Chrome浏览器里这段代码也是不起作用。
解决办法:
//改为:
context.Response.ContentType = "text/html";
</div>