javascript,跨域
$.ajax(
{
type: "get",
url: "http://172.16.35.31:8080",
cache: false,
async: true,
timeout : 1000,
data: "",
dataType:"jsonp",
jsonp: 'callback',
processData: false,
/*contentType: "application/json; charset=utf-8",*/
success: function(text){
alert("success");
},
error: function (XMLHttpRequest, textStatus, errorThrown)
{
/*XMLHttpRequest.status */ /*textStatus + ": " + errorThrown + ":" + */
alert("error:" + XMLHttpRequest.status + ":" + textStatus + ": " + errorThrown);
} ,
complete: function (XMLHttpRequest,status)
{
alert("complete" + XMLHttpRequest.status);
},
statusCode:
{
/*
404: function ()
{
alert(404);
},
200:function()
{
alert(200);
}
*/
}
});