javascript 同源主机,JS 中不同的端口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5714135/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Same origin host, different ports in JS
提问by F.P
for the two hosts
对于两位主持人
http://1.com.local/
http://2.com.local:8080/
how can I use document.domain
to enable DOM-Manipulation between the two? If i set both to com.local
it doesn't work, because the 2nd host then gets the domain com.local:8080
.
如何document.domain
在两者之间启用 DOM-Manipulation?如果我将两者都设置为com.local
它不起作用,因为第二个主机然后获取域com.local:8080
。
When I try to set the domain of the first one to com.local:8080
manually, the port is just snipped of and the domain remains com.local
.
当我尝试com.local:8080
手动将第一个域设置为com.local
.
How can I enable DOM-Manipulation in this situation?
在这种情况下如何启用 DOM 操作?