Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change browser address bar URL with jQuery [duplicate]

Tags:

Is it possible to change the URL in the browser address bar directly with jQuery without refreshing the page or redirecting to the changed url?

Or is this not possible due to security issues?

For example, I have a list which is jquery.ajax driven so no post backs/screen refreshes. The list has a paging element. So for the first page the url in the browser address bar is:

http://company/list.php?page=1 

If I click on page 2 from the paging section of the list, it displays the list based on page 2, but as this is happening ajax style without refreshing/posting back, the browser url remains at

http://company/list.php?page=1 

I want to be able to change it to

http://company/list.php?page=2 

without posting back/redirecting to the new url

Is this not possible?

like image 520
oshirowanen Avatar asked Feb 29 '12 10:02

oshirowanen


1 Answers

This can only be done in more modern browsers (Chrome, Safari, FF4+, and IE10pp3+)

See this question: Updating address bar with new URL without hash or reloading the page for information on how to do it.

like image 122
Tim Avatar answered Nov 23 '22 23:11

Tim