使用jQuery一切将会变得非常简单

请打开console控制台调试代码

js代码:
$.ajax({
type: "get",
async: false,
url: "http://demo.52fhy.com/jsonp/handJsonp.php",
dataType: "jsonp",
success: function (data, textStatus, jqXHR) {
console.log(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert('fail');
console.log(XMLHttpRequest, textStatus, errorThrown);
}
});
请求:
Request URL:http://demo.52fhy.com/jsonp/handJsonp.php?_=1460894887711&callback=jsonp1
Request Method:GET
Status Code:200 OK
响应:
{name: "52fhy", age: "22"}