1、不能接受http状态码
2、不能使用post提交数据
3、不能发送和接受http头
4、不能设置同步调用(默认为异步)
前台:
var retvlue = "";
if (!MemChkLogin()) { return false; }
$.ajax({
async: false,
url: "http://test.inx.dichan.com/axsh/GuanZhuNew.ashx?callback=?",
data: { "ran": Math.random, "action": 1, "uids": escape(e) },
dataType: "jsonp",
jsonpCallback: "callfun",
success: function(data) { alert(data.markup); }
})
return retvlue;
function callfun()
{}
使用jsonp时,[async:false]是无效的
后台: callbackfun = context.Request.QueryString["callback"];
string json = string.Format("{{\"markup\":{0}}}",tips);
System.Web.HttpContext.Current.Response.Write(callbackfun + "(" + tips + ")");
System.Web.HttpContext.Current.Response.End();