解决方法是:
复制代码 代码如下:
//里的内容时,是跨域访问,需要使用jsonp,为配合其工作需要添加下面两句,生成jsonp返回
context.Response.ContentType = "text/plain";
context.Response.Write(string.Format("{0}('OK')", context.Request["callback"]));
复制代码 代码如下:
//jsonp调用进行跨域访问
jQuery.ajax({
url: url,
type: 'GET',
data: data,
dataType: 'jsonp',
success: function (data) {
window.location.href = toURL;
}
});
