How to make this thing, i want when giving a location.has开发者_如何转开发h, to output in the addres bar like this, for example..
I have
location.hash = "asd";
And it will output #asd
But how to make to output only asd
If you want to modify the URL using JavaScript without actually loading a new page, you need to use the HTML5 history API and its pushState method.
- http://diveintohtml5.ep.io/history.html
- http://html5demos.com/history
- https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#section_4
I think you want:
location.href
精彩评论