js获取顶级域,一级域名

版权声明:本文为博主原创文章,未经博主允许不得转载。喜欢的用小手点击文章下面的顶,不喜欢的点下踩 https://blog.csdn.net/sethcss/article/details/72783344
<script type="text/javascript">
location.href="http://www."+document.domain.split('.').slice(-2).join('.')
</script>

猜你喜欢

转载自blog.csdn.net/sethcss/article/details/72783344