2011/8/13 dtang85 <dtan...@gmail.com>:
> I have created a photo gallery and the Previous and Next buttons load
> new content using Ajax. I want to change the URL so that each page can
> be bookmarkable. I have looked through MDN at the location object, and
> I am able to do this with location.hash. However, the browser does not
> send the hash to the server, so I cannot parse for the hash in my PHP.
> I've seen this technique on Facebook as you flip through photos. Is
> there another way to change the URL without using a hash?

This is what the History API in HTML5 is for
(http://diveintohtml5.org/history.html). Also you can send the data in
the hash to your server side via XHR or similar techniques. You can
also detect hashchange event
https://developer.mozilla.org/en/DOM/window.onhashchange, some
browsers have built in support for that, in others you could use
setTimeout or setInterval to check for the hash change (and also there
are plugins / frameworks for that).

-- 
Poetro

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/jsmentors@jsmentors.com/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/jsmentors@googlegroups.com/

To unsubscribe from this group, send email to
jsmentors+unsubscr...@googlegroups.com

Reply via email to