document.URL vs window.location.href All In One document.URL 与 window.location.href 两者有啥区别 document.URL; window.location.href; ??? 啥区别 兼容性 不同 https://caniuse.com/?search=document.URL https://caniuse.com/?search=window.location.href Document API https…
以前如果要使iframe里面的脚本能访问parent的内容,但iframe和parent的二级域名相同,那一般都会在两者都写上document.domain="xxx.com" 以放宽访问权限. 今天发现,如果iframe和parent在同一个三级域名下,比如都是aa.bb.com,那设了document.domain反而会造成访问拒绝. 查了下MSDN,有如下解释: Remarks The property initially returns the host name of the…