oh ok i see what you're saying. on page load, get the hash value and make a request to load the content. that worked well. thanks! Is location.hash supported in IE? I have a mac, but i do know it is supported in chrome and FF.
On Aug 13, 12:26 pm, Poetro <[email protected]> wrote: > 2011/8/13 dtang85 <[email protected]>: > > > 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 > eventhttps://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/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
