1

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

Hi all,

I have a list of href links (but1 - but4) that I can click. The data is preloaded and stored as JSON. When I click a link, I would like to change the URL, eg fakeURL.com -> fakeURL.com/but1

I know this can be done by using the window.location.hash function, but I'd prefer to modify the url directly.

An example of this is github (https://github.com/apache/hadoop-common) where if you click on a folder in a repository, the url changes and the folder is loaded (via AJAX, so slightly different, but if I understood their solution I can modify to my case)

Any idea how to do this?

Thanks, djs22

EDIT: I'd prefer a solution more robust than html5 history.pushState .

Community
  • 1
  • 1
djs22
  • 1,068
  • 3
  • 13
  • 28

1 Answers1

0

It's not possible to change the url. That would be a huge security flaw. I can't find any ajax at github, the page reloads, and a new url is displayed. The only part of the url that can be changed with javascript is the hash-part.

TheQ
  • 6,243
  • 4
  • 33
  • 51