1.使用jsonp发送ajax请求
ajax发送jsonp格式一般类型要指定为get请求
//ajax跨域访问可以使用jsonp的格式
function test(){
$.ajax({
url: "http://192.168.1.204:8910/mobile/checkService",
type: "get",
dataType: 'jsonp',
async: true,
cache: false,
jsonp:"callback",
jsonpCallback:"findImplNodeBack",
data:{
},
success: function(rel){
},
error: function(xhr,status,error){
console.log("status="+status+" error="+error);
}
});
}
//回调函数
function findImplNodeBack(rel){
//获取返回结果
console.log("rel="+rel.result);
}