views:

32

answers:

1

Jquery, AJAX and URL changes...

I have a gallery, and when the image change i would like to change my url to "#image_id=321" and when i load an url with this appended: "#image_id=321", loads the image with id 321.

is this possible to make without the "#" and using "/photo-id/321"? thanks

+2  A: 

No. If you change anything more than the fragment identifier, you change the page, and it is no longer Ajax.

As a rule of thumb, if the information is significant enough to bookmark, then Ajax is probably going to cause more harm than good.

David Dorward
I use like this: '/image_id/33' is the same as 'image_id/12#image_id=33'...and i really need ajax, because i dont want to make users to lose their time everytmie they want to view a new image.. with ajax is a lot faster..
Totty
I'd say "if the information is significant enough to bookmark, and you must use Ajax, render a fragment identifier, then ensure your code properly handles those identifiers in js to get the user back to where there were."
Jonathan Julian
may you give me an example, please?
Totty
And example of what? Doing what you are doing already but don't want to?
David Dorward