如何使用 jquery ui 选项卡将远程选项卡设置为本地?
我有一个本地主选项卡和一个通过 ajax 加载的选项卡。问题是用户需要转到第三个选项卡并返回 ajax 选项卡,内容仍然存在。现在,每次您单击它时,它都会重新加载 ajax 选项卡,并且用户会丢失他们的信息。我正在尝试通过 ajax 加载选项卡,然后将其转换为本地选项卡,以便用户不会丢失其信息。
I have a local main tab and a tab loading via ajax. The issue is that the user needs to go to a third tab and come back to the ajax tab with the content still there. Right now it just reloads the ajax tab each time you click on it and the user loses their info. I am trying to load the tab via ajax and then turn it into a local tab so the user doesn't lose their information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要修改 jQuery 选项卡脚本才能执行此操作。您需要识别不想再次加载的选项卡,并在这种情况下跳过 Ajax 调用。您可以在单击此选项卡时为其添加一个类名,然后如果选项卡具有此类名,则跳过 Ajax 调用。
You'll need to modify the jQuery tabs script in order to do this. You'll need to identify the tab you don't want loaded a second time and skip of the Ajax call on this condition. You can add a class name to this tab when it is clicked, and then skip the Ajax call if the tab has this class name.