I plan on buying two domain names for the same site.
(我计划为同一网站购买两个域名。)
Depending on which domain is used I plan on providing slightly different data on the page.(根据所使用的域,我计划在页面上提供略有不同的数据。)
Is there a way for me to detect the actual domain name that the page is loading from so that I know what to change my content to?(有什么方法可以检测页面从中加载的实际域名,以便我知道将内容更改为什么?)
I've looked around for stuff like this but most of it doesn't work the way I want it to.
(我到处寻找这样的东西,但大多数都无法达到我想要的方式。)
For instance when using
(例如当使用)
document.write(document.location)
on JSFiddle it returns
(在JSFiddle上它返回)
http://fiddle.jshell.net/_display/
ie the actual path or whatever that is.
(即实际路径或其他。)
ask by Freesn?w translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…