$.ajax({
type : "POST",
url : url,
cache: false,
async : false,
data : jsonData,
dataType : 'json',
timeout : 10000,
crossDomain:true, //設置跨域爲true
xhrFields: {
withCredentials: true //默認情況下,標準的跨域請求是不會發送cookie的
},
success : function(obj) {
......
},
error : function(data) {
......
}
});