日常小记

利用js实现不同域名显示不同备案的方法

<p>©2018 All rights reserved <a href="http://www.beian.miit.gov.cn/" id="beian">备1803号-1</a></p>     

<script>

var domain = window.location.host;
if (domain == "www.123.com" || domain == "123.com") {
    document.getElementById("beian").innerHTML = "18050号-1";
}
else if (domain == "www.456.com" || domain == "456.com") {
    document.getElementById("beian").innerHTML = "190362号";
}

</script>

回复

This is just a placeholder img.