首页技术博客 技术经验 正文

js获取当前域名

2021-09-20 846 0条评论
<script language="javascript">
//获取域名
host = window.location.host;
host2=document.domain; 
//获取页面完整地址
url = window.location.href;
document.write("<br>host="+host)
document.write("<br>host2="+host2)
document.write("<br>url="+url)
</script>


文章版权及转载声明

本文作者:符文浩 网址:http://blog.fuwenhao.com/post/456.html 发布于 2021-09-20
文章转载或复制请以超链接形式并注明出处。

发表评论

快捷回复:

评论列表 (暂无评论,846人围观)参与讨论

还没有评论,来说两句吧...

取消
微信二维码
微信二维码
支付宝二维码