JavaScript change request string to update

I am looking for a way to change the get request string of an html request using javascript (jquery enabled) without refreshing the page. This query string will be carried forward during the upgrade. For example, http://thissite.site/index.html?id=123 will be the source url, then an event will occur and the id will change to 235. When the page refreshes, the updated link will be http://thissite.site/index.html?id=235.

+4
source share
2 answers

With HTML 5, you can use the following pushState function . More information is found on How does pushState protect against potential content fakes? .

I searched this too and saw bandcamp use this to navigate through http://bandcamp.com/discover

0
source

Source: https://habr.com/ru/post/1432342/


All Articles