1

I would like to change part of my page when user clicks a link with jquery ajax. How can I change the url accordingly without full page reload (url should be changed to page1, page2 and so on)? Server side is GAE.

Looks like I need to change url hash with javascript:

location.hash = "page2"

How to get this value with GAE?

Community
  • 1
  • 1
LA_
  • 19,823
  • 58
  • 172
  • 308

2 Answers2

4

Hash values aren't included in the HTTP request to the server. Typically the way to handle this is to dynamically change your page based on the result from the HTTP request (that is, changing DOM elements via javascript); updating the hash value is a nice thing to do so the browser's 'back' button works.

Moishe Lettvin
  • 8,462
  • 1
  • 26
  • 40
2

http://plugins.jquery.com/project/history-js is a library that uses the new "pushState" to update the url via javascript on the fly, and falls back to using the hash on older browsers. Might want to give it a look.

Kzqai
  • 22,588
  • 25
  • 105
  • 137