简体   繁体   中英

Ajax url segments with jquery using AJAX crawling scheme

I am researching how to approach loading content with ajax for my web application

I notice twitter are using the google AJAX crawling scheme: (http://code.google.com/web/ajaxcrawling/)

but instead of: http://twitter.com/who_to_follow#!key=value

they are using something like: http://twitter.com/#!/who_to_follow/suggestions

How would I handle segments instead of #key=value in a ajax request with jquery?

any help/advice is much appreciated Jon

You can use the DOM window object to load the full hash fragment:

q = window.location.hash.substring(1);

q would contain everything on the right side of the hash. You can then split q on '/' and reference the result partitions as an array. There are code examples for this here: http://goo.gl/0lJ0J

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM