public class Script
{
public static void Alert(string message)
{
ResponseScript(" alert('" + message + "');");
}
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");
}
}
script type="text/javascript">
//![CDATA[
alert('溫馨提示:有重復(fù)的用戶!');
window.history.back();
//]]>
/script>
后來發(fā)現(xiàn),原來360瀏覽器的極速模式調(diào)用的是Google瀏覽器的Chrome內(nèi)核,所以Chrome瀏覽器里這段代碼也是不起作用。
//將:
context.Response.ContentType = "text/plain";
//改為:
context.Response.ContentType = "text/html";