$.ajax({
type: "GET",
url: "http://love.com/Test.php",
dataType: "jsonp",
// jsonp:"somfun",
success:function(msg){
console.log(msg.msg);
},
error:function (error) {
console.log(111);
console.log(error);
扫描二维码关注公众号,回复:
4751445 查看本文章
}
});
http://love.com/Test.php
$data['msg']=1; //echo $_GET['somfun'].'('.json_encode($data).')'; echo $_GET['callback'].'('.json_encode($data).')';