前几天你很有帮助。现在我有另一个问题。我有一个小书签来获取当前的 URL,或者我应该说主机名(没有http://
部分 - 没关系),例如:
javascript:q=(document.location.host); void(open('http://mysite.com/search.php?search='+location.host,'_self','resizable,location,menubar,toolbar,scrollbars,status'));
问题是这个小书签只抓取像 google.com 这样的主机名,而不是像 google.com/sub/page.htm 这样的整个地址。有什么办法可以留下http://
部分并抓住剩余的网址?