您可以将选项卡保存在 localStorage 中:
$('a[data-toggle="tab"]').on('shown', function (e) {
localStorage['selectedTab']=$(e.target).attr('href');
})
并稍后恢复它
var selectedTab = localStorage['selectedTab'];
if (selectedTab) $('#myTab a[href="'+selectedTab+'"]').tab('show');