Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manipulate the URL with Javascript and JQuery?

I want to make a page with a lot of Javascript interactions. However, while a user navigates through the page the URL must change too. So, when the user shares the URL or saves it, it can lead him to the actual state he was.

How can I do that?

Examples:

myapp.com/page1

myapp.com/page2

like image 581
Hugo Mota Avatar asked Jul 06 '11 19:07

Hugo Mota


1 Answers

pushState, as seen on github

like image 138
Quentin Avatar answered Nov 14 '22 21:11

Quentin