简体   繁体   English

jQuery UI选项卡-还记得没有cookie的最后一个选项卡吗?

[英]jQuery UI tabs - remember last tab without cookies?

So, I have a page using jQuery tabs. 因此,我有一个使用jQuery标签的页面。 I've got it set up to remember the last tab selected using cookies. 我已经设置好它来记住使用cookie选择的最后一个选项卡。 All is working fine, but there is some concern about the overhead using cookies. 一切工作正常,但是使用cookie会产生一些开销。

We need to remember the last tab, even if someone went to a different page and came back. 我们需要记住最后一个选项卡,即使有人转到另一个页面并返回。

Is there another solution to remember the last tab, apart from cookies, that will work well with jQuery UI tabs? 除了cookie之外,还有没有其他方法可以记住最后一个选项卡,它可以与jQuery UI选项卡一起很好地工作? (ie, URL string query, hidden form fields?). (即,URL字符串查询,隐藏的表单字段?)。 It seems the other "possible techniques" won't work if you leave the page and come back. 如果您离开页面再返回,似乎其他“可能的技术”将无法工作。 Am I missing anything? 我有什么想念的吗?

EDIT: Per the below, I'm not concerned about the <50 byte cookie personally, but some others on the team are. 编辑:根据下面的内容,我个人并不担心<50字节的cookie,但团队中的其他一些人则对此感到担忧。 It is a very busy site, with huge amounts of data, so any extra load always raises an eyebrow. 这是一个非常繁忙的站点,拥有大量数据,因此任何额外的负载总会引起您的注意。 I think the concern was that this cookie will get passed with every server request, even though it's only used/needed on one page in the whole site. 我认为,担心的是,即使仅在整个站点的一页上使用/需要此cookie,它也会随每个服务器请求一起传递。 The other option is to store it in our server side session I suppose, but is this really better (server impact-wise)? 另一个选择是将其存储在我认为的服务器端会话中,但这真的更好(在服务器影响方面)?

As i understand from your question, you will need to persist the data somehow.. so that when user revisits the page,you can show him the last tab. 据我从您的问题中了解到,您将需要以某种方式保留数据。以便在用户重新访问该页面时,您可以向他显示最后一个选项卡。 Sessions are a good way to do it. 会议是实现此目标的好方法。 And this info will only add a small memory footprint on the server side. 而且此信息只会在服务器端增加少量内存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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