Hi,
I'm trying to make an Ajax gallery, and (using Mootools and HistoryManager) I can:
- Set the address hash when changing photos (e.g. for the 4th photo the address ends with #photo(4) etc..)
- Read the address hash when manually changing the address
This degrades to a non-ajaxed gallery:
- So links to larger images are of the form photos/4/ say (which are converted to say photos.php?num=4 using .htaccess), and the correct image shown using a bit of php
- In these "non ajax" pages, I can have some javascript that automatically forwards the user from photos/4/ say to #photos(4) if javascript is enabled. Thus this automatically "upgrades" to the ajax gallery.
However, I would also like to handle the case where a non-javscript user uses one of the ajax hash addresses. Say they get a link from a friend ending in #photos(4).
I have thought about processing the hash server-side, and automatically forwarding to /photos/4/, but then if the user has javascript turned-on, they will be forwarded to #photos(4) by the automatic-upgrading Javascript, and so end up in an endless loop!
Is there a way to handle the case of a non-javascript user using a hash address, and still show the correct photo?
Michal.