我使用jQuery版本jquery-1.8.2.js和jquery-ui.js v1.9.0。我有一个PHP页面index.php。它加载得很好,当我打开index.php,但当我切换标签的内容需要时间加载我已经查看了萤火虫的细节jquery-1.8.2.js花了4.84秒,jquery-ui花了8.32秒,ajax花费了659ms。似乎jQuery是采取足够的时间在装载和我无法找到我的index.php中下面的代码的原因jQuery UI选项卡,当我切换到第二个选项卡的js和jQuery文件需要时间加载
$(function() {
$("#tabs").tabs({
beforeLoad: function(event, ui) {
ui.jqXHR.error(function() {
ui.panel.html(
"Couldn't load this tab.");
});
}
});
});
<div id="tabs">
<ul>
<li><a href="#tabs-1">Set Up</a></li>
<li><a href="temp1.php">temp1 </a></li>
<li><a href="temp2.php">temp 2</a></li>
<li><a href="temp3.php">temp 3</a></li>
</ul>
<div id="tabs-1">
content here
</div>
</div>
和temp1.php我有一个AJAX方法,其填充数据在一张桌子里。
我正在按照本教程www.jqueryui.com/tabs/#ajax – bewithyou
你能从Google CDN调用jQuery? – Mooseman