AJAX 模式下的 jquery 选项卡帮助 for Safari
jquery tabs in ajax mode help for safari
我在ajax模式下创建了jQuery选项卡。
在我的一个选项卡中,我有一个使用的应用程序后退按钮 javascript: history.go(-1)
.
在IE中一切正常。当我单击后退按钮时,它会将我带到 iFrame 中的初始页面。 但是当我在 Safari 中尝试相同的功能时,该按钮会将我带到我的主页。我还意识到Safari的浏览器按钮做同样的事情,而IE的浏览器按钮完美地工作。
我不明白我的页面这样做的原因。有什么想法可以解决吗?
<meta charset="utf-8">
<script>
$(function() {
$( "#tabs" ).tabs({
ajaxOptions: {
error: function( xhr, status, index, anchor ) {
$( anchor.hash ).html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo." );
}
}
});
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Preloaded</a></li>
<li><a href="ajax/content1.html">Tab 1</a></li>
<li><a href="ajax/content2.html">Tab 2</a></li>
<li><a href="ajax/content3-slow.php">Tab 3 (slow)</a></li>
<li><a href="ajax/content4-broken.php">Tab 4 (broken)</a></li>
</ul>
<div id="tabs-1">
<p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
</div>
</div>
</div><!-- End demo -->
<div class="demo-description">
<p>Fetch external content via Ajax for the tabs by setting an href value in the tab links. While the Ajax request is waiting for a response, the tab label changes to say "Loading...", then returns to the normal label once loaded.</p>
<p>Tabs 3 and 4 demonstrate slow-loading and broken AJAX tabs, and how to handle serverside errors in those cases. Note: These two require a webserver to interpret PHP. They won't work from the filesystem.</p>
</div><!-- End demo-description -->
尝试使用javascript: self.history.go(-1)
出现此问题是因为 Safari 尝试调用 window.history.go(-1) 导致您的问题
延伸阅读: http://benalman.com/news/2009/12/webkit-bug-hash-history-iframe/
相关文章:
- 需要帮助设置json数组
- JQuery需要帮助理解(i,el)
- 为什么JavaScript在for循环为3时向所有4发出警报
- 另一个ajax调用中的Jquery ajax调用在for循环中没有按预期工作
- 如何在输入字段中的按钮的帮助下打开日历,该字段的类型为“=”;日期”;
- Is onfling available for html, html5
- 有人能用for循环和splice命令帮助编辑Javascript字符串吗
- 后退按钮&iFrame for Android-帮助noob
- 在帮助程序函数中使用 for 循环的正确方法 |流星
- 需要帮助在量角器中使用 for 循环和 getText()
- Javascript 初学者帮助 - 数组、while 和 for 循环
- JavaScript 中的 for loop - 任何可以帮助我理解的人
- 需要帮助Regex for python
- 需要帮助合并2个位置数组和for循环
- 需要javascript for循环的帮助
- For循环错误,需要帮助解决
- 需要帮助理解mongodb聚合$cond的for循环
- 这个javascript代码在没有for循环的情况下运行正常,但没有它.任何帮助,我都试过了
- AJAX 模式下的 jquery 选项卡帮助 for Safari
- jQuery函数在JavaScript for循环中不起作用.请帮助