2

Right now I have my site set up so that the url to each page is like http://www.tri-peoria.org/#Schedule or http://www.tri-peoria.org/#JoinUs so that I can use an AJAX loader to change pages without reloading the header. How would I get my urls to work without a hash so that they would look like http://www.tri-peoria.org/Schedule or http://www.tri-peoria.org/JoinUs?

Tyler Siegrist
  • 139
  • 4
  • 10
  • possible duplicate of [Why the new web Dropbox can change the URL without page refresh?](http://stackoverflow.com/questions/9717801/why-the-new-web-dropbox-can-change-the-url-without-page-refresh) – Quentin Feb 04 '13 at 14:03

2 Answers2

0

You can use the history API to achieve this, assuming that you handle all those urls correctly on your server (meaning, they all go to the same page).

Look at history.pushState() .replaceState() and .popState()

https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history

(Please note that this doesn't work in IE9 or less)

jishi
  • 24,126
  • 6
  • 49
  • 75
0

Using history.pushState method. There is some support issues, so I recommend you to use a lib like https://github.com/browserstate/History.js/.

balupton
  • 47,113
  • 32
  • 131
  • 182
Tasso Evangelista
  • 1,612
  • 1
  • 16
  • 23