[問題] XMLHttpRequest() and https in Google Chrome?
請問一下,以下是我的 sample code,我用 http 去存取網頁的時候,不會跳到
catch(e) 那一段,但是如果我用 https 的話,alert("hello"); 那一個敘述就
不會出現,且會跳到 catch(e) 那一段,我想是 xmlhttp.send(null); 這一行
出錯,然後會 show 出 alert message,我有試過 IE 及 Safari,這兩個卻是
ok的,請問一下有人有遇過 Google Chrome 成功的嗎?感謝回答。 :>
try {
var xmlhttp = new window.XMLHttpRequest();
xmlhttp.open("get", "test.xml", false); // synchronous
xmlhttp.send(null);
alert("hello");
_xmlDoc = xmlhttp.responseXML;
} catch(e) {
alert("Something error!!");
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.220.210.222
推
08/06 08:10, , 1F
08/06 08:10, 1F
→
08/06 08:10, , 2F
08/06 08:10, 2F
→
08/06 12:27, , 3F
08/06 12:27, 3F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章