1

Possible Duplicate:
How to rewrite URL without refresh, like GitHub.com

let say I have variable in Javascript

var currentpage = 0;

my address page address is www.xyz.com/page/1

when I click somewhere and js function trigger

currentpage = 1
//Here I want to change/rewrite www.xyz.com/page/2
//Without redirecting to this page
Community
  • 1
  • 1
SOF User
  • 7,590
  • 22
  • 75
  • 121
  • To clarify, you're trying to rewrite the URL displayed in the browser bar without actually changing the page that you're on? – arychj Apr 29 '11 at 20:38

2 Answers2

5

See pushState (browser support currently limited).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
1

You can't. You have to use the '#' or '#!' notation and pass the page number after it, then do trigger some js on load to figure out which page to display.

Damp
  • 3,328
  • 20
  • 19