steventnorris
steventnorris

Reputation: 5896

Javascript change query string for refresh

I am looking for a way to alter the get query string of an html request using javascript (jquery included) without refreshing the page. This query string would be carried over when refresh. For instance, http://thissite.site/index.html?id=123 would be the original url, then an event happens and id changes to 235. When the page is refreshed, the refreshed link would be http://thissite.site/index.html?id=235.

Upvotes: 4

Views: 4344

Answers (2)

Drakarah
Drakarah

Reputation: 2262

With HTML 5 you can use the the following pushState function. More info found on How does pushState protect against potential content forgeries?.

I was looking for this as well and saw bandcamp using this for the navigation on http://bandcamp.com/discover

Upvotes: 0

Related Questions