日期:2014-05-17 浏览次数:20447 次
public void ProcessRequest(HttpContext context)
{
// context.Response.ContentType = "application/x-javascript";
context.Response.Write("<script src=\"Scripts/jquery-1.4.1.min.js\" type=\"text/javascript\"></script>");
context.Response.Write("<script src=\"http://192.131.0.18:80/jscript/en.js\" type=\"text/javascript\"></script>");
context.Response.Write("<script type=\"text/javascript\">");
context.Response.Write(" var a=GetCookie();");
context.Response.Write("document.write(a);");
context.Response.Write("</script>");
}
function GetCookie() {
$.getJSON("http://192.131.0.18:80/ajax/GetCookie.ashx?jsoncallback=?", {},
function (data) {
document.write(data.link) //为什么不会输出呢?
});
}
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write(context.Request.QueryString["jsoncallback"]+ "({\"link\":\"" + HttpContext.Current.Request.Cookies["lan"].Value+ "\"})" );
}