Ajax deep linking? [closed]

走远了吗. 提交于 2019-12-03 08:20:36

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.

You may found my article at http://blog.onthewings.net/2009/04/08/deep-linking-for-ajax/ useful. It was made for my Web 2.0 course in the university.

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

UPDATE: if you use jQuery look at their jQuery Address

If you're using jquery you might want to have a look at this:

Deep Linking with jQuery Address plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!