Request address in JavaScript
本问题已经有最佳答案,请猛点这里访问。
Possible Duplicate:
Get current URL with JavaScript?
你如何在JavaScript中获得你所在页面的地址?
例如,如果我在
你需要使用:
     
你可以在这里阅读更多。 或者那里有更多的解释。
澄清问题:
最初由Mozilla开发人员中心发布
document.location was originally a
read-only property, although Gecko
browsers allow you to assign to it as
well. For cross-browser safety, use
window.location instead.
| 1 | window.location.href; | 
要么
| 1 | location.href; | 
您要找的是
我相信
| 1 | document.location.href | 
要么
| 1 | window.location.href | 
document.URL