Gmail like URL scheme

。_饼干妹妹 提交于 2019-12-03 02:47:01

Yeah--you're headed in exactly the right direciton, and there's a ton of work that has gone into doing this correctly across all browsers and OSes. One of the hardest parts to get right is enabling the browser's back and forward buttons to work correctly when you're using that #urlfragment syntax.

A library that provides support for such a thing: http://developer.yahoo.com/yui/history/

I find the google wave app's solution to be quite elegant. It's basically what you describe using a parseable url fragment. like so: http://some.domain/some/url/#filters(filter1:key1,filter2:key2);someOtherfragment;andAnotherFragment

Well if you are using jQuery there is this lovely library by Asual: jQuery Address for deep linking. They have a good API reference, and examples. It will give you all the tools you need to implement your app.

This is somewhat of a simple answer, but what you want to look at is using a hidden iframe method for your AJAX, as opposed to XHR (XMLHttpRequest Object). This will allow for the browser to maintain the history, so your back buttons will continue to work.

Some more: http://ajaxpatterns.org/IFrame_Call

Ben Alman has built a full-featured jQuery plugin for this called BBQ. IMO, it's much better than the Address plugin.

Using the yui library for history is an option as mentioned in sblom's comment. You may want to consider just providing a bookmark or link button on your page that user's can click on to get to the urk if you do not want to deal with cross browser compatibility issues.

We do it here http://connect.garmin.com/explore#sortField=relevance&currentPage=1 Theres a link on the top of the map.

In Chrome, Safari and Firefox you can use HTML5 history.pushState and history.replaceState() methods

Some documentation here and here.

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