作者Xphenomenon (啦 )
看板Ajax
标题[问题] XMLHttpRequest() and https in Google Chrome?
时间Tue Aug 4 20:21:24 2009
请问一下,以下是我的 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
1F:推 buganini:目前这页是http还是https? 有些时候http跟https 08/06 08:10
2F:→ buganini:被视为不同网域 08/06 08:10
3F:→ Xphenomenon:一样都是 https 08/06 12:27