0

在 IE7 中如果location.hostname更改前读取,更改document.domain后 document.domainlocation.hostname将无法再读取!!

alert(window.location.hostname);
document.domain = document.domain;
alert(window.location.hostname);  // Access denied on IE7!

这是jsfiddle:http: //jsfiddle.net/yQwam/1/

并直接链接到页面: http: //fiddle.jshell.net/yQwam/1/show/

4

0 回答 0