域名停放时,需要处理网址提取域名。
JS代码如下:
1 2 3 4 5 6 7 8 9 | <script> no_www_url = document.domain ; if (no_www_url.substr(0,4) == "www." ) { no_www_url = no_www_url.substring(4,no_www_url.length) }; document.write( "<font size=7 face=georgia,blod color=#000000>" +no_www_url+ "</font><br><br><br><br>" ) document.write( "This domain for sale! send your offer to info (at) vincentliao.com <br>" ) </script> |
在源码中可以通过 ” + no_www_url + ” 提取域名作为变量。
效果参考:
http://www.forsale.tw
http://www.forsale.tw/index
http://forsale.tw/index
作者:
http://club.domain.cn/forum.php?mod=viewthread&tid=1852516
http://club.domain.cn/forum.php?mod=viewthread&tid=1852516