我使用jQuery ui选项卡,脚本如下:
JS
$(document).ready(function() {
var tab_index = $('#tab_index').attr('value');
$('#tabs').tabs({ cache:true,
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.");
}
},
});
$('#tabs').tabs('option', 'active', tab_index);
});