阿賈克斯不僅僅在iPad在iPad上
Sended!
Completed with status: timeout;
Error: timeout
警報在IE瀏覽器
$.ajax({
url : 'http://www.othersite.com/GetUrl?Callback=?',
dataType : 'json',
contentType : 'application/json; charset=utf-8',
type : 'GET',
timeout : 5000,
cache : false,
crossDomain : true,
async : true,
data : { id : 100, noCache : new Date().getTime() },
beforeSend : function(XMLHttpRequest) { alert('Sended!'); },
complete : function(XMLHttpRequest, textStatus) { alert('Completed with status: ' + textStatus) },
success : function(data){ alert('Success with response:' + data.response); },
error : function(xhr, textStatus, errorThrown){ alert('Error: ' + textStatus); }
});
警報(7,8,9 ,10,11),火狐,Chrome,歌劇,Safari桌面
Sended!
Completed with status: success
Success with response: http://www.google.com/
服務器應用程序在50毫秒(平均響應)
echo $_GET['Callback'].'('.json_encode(array('response' => 'http://www.google.com/')).')';
服務器響應頭
Access-Control-Allow-Origin: *
Cache-Control: no-cache
Connection: close
Content-Length: 152
Content-Type: application/json; charset=utf-8
Date: Tue, 02 Dec 2014 09:52:46 GMT
Pragma: no-cache
服務器響應體
jQuery19109435868220625793_1417512417785({"response": "http://www.google.com/"})
服務器日誌有來自iPad的請求,但似乎所有從其他瀏覽器。
爲什麼會發生這種情況?
看起來來自iPad的請求在服務器上超時。沒有看到服務器在這個請求中正在做什麼,它幾乎不可能回答這個問題。 – 2014-12-02 10:30:24
簡單'echo $ _GET ['Callback']。'('。json_encode(array('response'=>'http://www.google.com/'))。')';' – ar099968 2014-12-02 10:38:00
是您的服務器證書-protected? – faby 2014-12-02 10:44:03