[問題] XMLHttpRequest() and https in Google Chrome?

看板Ajax作者 (啦 )時間16年前 (2009/08/04 20:21), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
請問一下,以下是我的 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
目前這頁是http還是https? 有些時候http跟https
08/06 08:10, 1F

08/06 08:10, , 2F
被視為不同網域
08/06 08:10, 2F

08/06 12:27, , 3F
一樣都是 https
08/06 12:27, 3F
文章代碼(AID): #1AU2V55F (Ajax)
文章代碼(AID): #1AU2V55F (Ajax)