HTML domain 屬性

定義和用法
domain 屬性可返回下載當(dāng)前文檔的服務(wù)器域:
語法
document.domain
瀏覽器支持
所有主要瀏覽器都支持 domain 屬性
實(shí)例
實(shí)例
返回下載當(dāng)前文檔的服務(wù)器域名:
<html>
<body>
加載這個(gè)文件的域名:
<script>
document.write(document.domain);
</script>
</body>
</html>
<body>
加載這個(gè)文件的域名:
<script>
document.write(document.domain);
</script>
</body>
</html>
嘗試一下 ?

更多建議: