不同域名访问显示不同备案号
我们就以域名和备案号举例
sudu.cn 备案号:蜀ICP备07504800号-1
sudu.net 备案号:蜀ICP备07504800号-2
sudu.com 备案号:蜀ICP备07504800号-3
就需要在挂备案号的地方用以下代码
<a href=”http://beian.miit.gov.cn/” id=”BeiAnHao” style=”color:#666;” target=”_blank”>蜀ICP备07504800号-1</a>
<script>
var yuming = window.location.host;
if (yuming == “www.sudu.cn” || yuming == “sudu.cn”) {
document.getElementById(“BeiAnHao”).innerHTML = “蜀ICP备07504800号-1”;
}
else if (yuming == “www.sudu.net” || yuming == “sudu.net”) {
document.getElementById(“BeiAnHao”).innerHTML = “蜀ICP备07504800号-2”;
}
else if (yuming == “www.sudu.con” || yuming == “sudu.com”) {
document.getElementById(“BeiAnHao”).innerHTML = “蜀ICP备07504800号-3”;
}
</script>