The following example you can refer to the following
<script>
$.ajax ({
Async:false,
URL: ' http://www.mysite.com/demo.do ',//cross-domain URL
Type: ' GET ',
DataType: ' Jsonp ',
JSONP: ' Jsoncallback ',//default callback
Data:mydata,
timeout:5000,
Beforesend:function () {//jsonp mode This method is not triggered. The reason may be that datatype, if specified as Jsonp, is not an AJAX event.
},
Success:function (JSON) {//client jquery pre-defined callback function, after successfully acquiring JSON data on a cross-domain server, this callback function is executed dynamically
if (json.actionerrors.length!=0) {
alert (json.actionerrors);
}
Gendynamiccontent (Qsdata,type,json);
},
Complete:function (XMLHttpRequest, Textstatus) {
$.unblockui ({fadeout:10});
},
Error:function (XHR) {
Jsonp mode This method is not triggered
Request Error Handling
Alert ("Request error (Please check correlation network status.)");
}
});
Attention:
$.getjson ("http://www.mysite.com/demo.do?name1=" +value1+ "&callback=?",
function (JSON) {
if (JSON. property name = = value) {
Execute code
}
});
</script>