index.html 大佬有话说 :
求让浏览器标签页自动显示来访域名的最简单代码
就是有几个域名 统一指向一个主机
然后我在那个主机丢一个页面 让他们都显示同一个页面
不过页面的域名是要变的 哪个进来的就显示哪个
https://i.loli.net/2020/04/26/6NYSnv9RXUa5ADM.jpg
求大佬指点迷津
index.html 大佬有话说 :
十分钟惨案。。。。
不知道有没有加在 <title> </title>之间的。。。。:'(
大师兄 大佬有话说 :
(function () {
var _hname = window.location.hostname;
var $title = document.querySelector(‘head title’);
if (!$title) {
var $head = document.querySelector(‘head’);
var $newTitle = document.createElement(‘title’);
$newTitle.innerHTML = _hname;
$head.appendChild($newTitle);
} else {
$title.innerHTML = _hname;
}
})();
js 随便找个地方加上