阅读标签的当前网址
问题描述:
我需要使用javascript阅读浏览器URL(标签为specefic)。我试过阅读标签的当前网址
var currentURL = window.location;
alert(currentURL.href) ;
它显示chrome://browser/content/browser.xul
而不是网址。 我应该怎么做才能得到网址?
有人可以帮助我这个。
谢谢!
答
可能已经得到了这个答案,但只是使用document.URL会让你的标签的URL。
javascript:(alert(document.URL))
你的意思是在Firefox的扩展? – YOU 2010-03-11 07:17:13
window.location.href不起作用? – 2010-03-11 07:21:17
+1 @Greg K:你应该在答案中写下这个:) – RubyDubee 2010-03-11 07:42:12