像URL方案一样的Gmail [英] Gmail like URL scheme

查看:101
本文介绍了像URL方案一样的Gmail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用票务系统,具有以下要求:

主页分为两部分:

Sec-1。这里显示了一些过滤器选项。(如封闭票,开票,所有票,门票分配给我等)。您可以选择一个或多个这些过滤器。

sec-2。满足以上过滤条件的门票列表将显示在此处。

I am working on a ticket system, having the following requirement:
The home page is divided into two sections:
Sec-1. Some filter options are shown here.(like closed-tickets, open-tickets, all-tickets, tickets-assigned-to-me etc.). You can select one or more of these filters.
sec-2. List of tickets satisfying above filters will be displayed here.

现在这就是我想要的:当我更改过滤器时

- >更改应该反映在URL中,以便能够为其添加书签。

- > ajax请求将会进行,并且满足所选过滤器的票证列表将在sec-2中更新。

Now this is what I want: As I change the filters
--> the change should be reflected in the URL, so that one is able to bookmark it.
--> an ajax request will go and list of tickets satisfying the selected filters will be updated in sec-2.

我希望使用相同的代码以两种方式加载票证 -

(a)选择那组过滤器和

(b)使用书签重新加载页面。

I want the same code to be used to load the tickets in both ways-
(a) by selecting that set of filters and
(b) by using the bookmark to reload the page.

我对如何做到这一点一无所知:

URL将包含选定的过滤器。(在#之后追加)

更改页面上的过滤器将修改URL的哈希部分并调用一个函数(比如ajaxHandler())来解析URL以获取过滤器然后发出ajax请求以获取要在section2中显示的票证列表。



我将在window.onload中调用相同的函数ajaxHandler()。 / em>

我觉得这是 Yahoo maps 所做的。

实施此类网址方案的最佳方法是什么?

我是朝着正确的方向前进的吗?

What's the best way to implement such URL scheme?
Am I headed in the right direction?

推荐答案

是的 - 你正朝着正确的方向前进,并且有大量的工作已经在所有浏览器和操作系统中正确地执行此操作。最难实现的部分之一是当您使用#urlfragment语法时,使浏览器的后退和前进按钮正常工作。

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.

提供支持的库这样的事情: http://developer.yahoo.com/yui/history/

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

这篇关于像URL方案一样的Gmail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆