javascript 獲取域名

<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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章