常用ajax代码
var requestUrl="http://localhost/1.html?callback=?";
$.ajax({
type : "get",
async:true,
url : requestUrl,
data : "channelid=7¤t=1&rowSize=4",
dataType : "jsonp",
success :function(data){
console.log("--------(xxxxx)-----success");
},
error:function(data){
console.log("error: (xxxxx)");
}
});
$.ajax({
type : "get",
async:true,
url : requestUrl,
data : "channelid=7¤t=1&rowSize=4",
dataType : "jsonp",
success :function(data){
console.log("--------(xxxxx)-----success");
},
error:function(data){
console.log("error: (xxxxx)");
}
});
//跨域要使用jsonp ,前端和后台都要使用callback,