jQuery UI 选项卡和缓存参数
要重现此行为,请单击:
- 选项卡 3 - 让它加载
- 选项卡 2
- 选项卡 3 - 它已经加载
- 选项卡 1
- 选项卡 3 - 现在正在再次加载
在代码中,它没有在 中使用
,所以内容应该被缓存,为什么它没有发生?cache:false
>ajaxOptions
干杯。
As I can see in the example http://jqueryui.com/demos/tabs/ajax.html, the component is sometimes getting the tab 3 content when I click on that tab. If you click two o more tabs and go back to 3 sometimes you will see how again it takes some time to get the content.
To reproduce this behavior click:
- tab 3 - let it load
- tab 2
- tab 3 - it is already load
- tab 1
- tab 3 - now is loading again
In the code it's not using cache:false
in the ajaxOptions
, so the content should be cached, why it's not happening?
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看此演示的主页,您会注意到以下评论:
为了演示的目的,他们破坏了选项卡 3 和 4(以不同的方式),以便用户可以了解如何处理 Ajax 错误。查看我上面链接到的页面上的源代码,了解他们正在做什么来破坏它。
另外,如果您向下滚动页面并查看选项,您会发现默认情况下缓存选项为 false。因此,如果未设置该选项,则该选项卡将不会缓存,因为它自动为 false。
If you look at the main page that this demo comes from, you'll notice this comment:
For the purposes of the demonstration, they broke tabs 3 and 4 (in different ways) so a user can see how to handle Ajax errors. Take a look at the source code on the page I linked to above to understand what they are doing to break it.
Also, if you scroll down the page a little more and look at the options, you'll notice that, by default, the cache option is false. So, if the option is not set, then the tab WILL NOT cache because it is automatically false.