Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax deep linking? [closed]

I have made a flex app deep link before but now I want to make an ajax app deep link.

I have no idea where to start.

I assume I need a way to listen for when the #hash in the url changes and be able to read it. And I assume I need a way to update the #hash in the url.

Does anyone know how to do all that?

Thanks!

like image 794
JD Isaacks Avatar asked May 22 '09 15:05

JD Isaacks


2 Answers

You're on the right track.

For each state of the ajax page that you want to be able to link to, change the hash tag:

window.location.hash = "this_state"

When the page loads you'll need to check if the window.location.hash value matches one of your states and if it does make the app go to that state. ("Listening" for the change of the hash tag is the page loading.)

This way your users can bookmark and share the states, making for a much more usable app, so props for caring about it.

like image 183
edeverett Avatar answered Oct 04 '22 18:10

edeverett


have a look at SWFAddress (deep linking for both Flash and Ajax)

UPDATE: if you use jQuery look at their jQuery Address

like image 29
Gideon Avatar answered Oct 04 '22 18:10

Gideon