JavaScript获取网站域名
2010-04-19 13:54 诸葛二牛 阅读(402) 评论(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>
//获取域名
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>