HTML:
$.ajax({
type: "get",
async: false,
url: "http://www.xxxxxx.com/otherLogin/checkLogin.aspx?isParam=1&rad=" + Math.random(),
dataType: "jsonp",
jsonp: "callbackparam",//服务端用于接收callback调用的function名的参数
jsonpCallback: "success_jsonpCallback",//callback的function名称
success: function (json) {
alert(json[].userName);
},
error: function (e) { }
});
接收页面:
Response.Write(Request.QueryString["callbackparam"] + "([{userId:0,userName:\"def\"}])");