目錄
href
var source=window.location.href; if(source.indexOf('www.example.com')>0){ ... }
hostname
if(window.location.hostname == "www.example.com"){ ... }
<span>網址: <script>document.write(window.location.hostname);</script></span>