两个域名加入一个网站。例如,域A和B与网站C的链接。
在contact.php页面上,当用户使用域A查看时,我想在contact.html中隐藏一些内容。例如,图像,单词等。
但是有了域名B,他就可以看到所有的contact.php页面。
发布于 2013-07-29 00:38:51
此演示将在控制台中记录站点的当前域名
var current_domain = document.location.hostname;
console.log(current_domain);
if (current_domain == "example.com") {
//code for hiding stuff goes here
} else if (current_domain == "example21.com") {
//code for that page here
}https://stackoverflow.com/questions/17866296
复制相似问题