Javascript Jquery Ui选项卡url与页面库存在问题

Javascript Jquery Ui选项卡url与页面库存在问题,javascript,jquery,jquery-ui-tabs,Javascript,Jquery,Jquery Ui Tabs,我对jqueryui选项卡有问题 我有以下代码: //The jQuery Tabs $( "#tabs" ).tabs(); //Code to open the correct tab if i write the hash on the url. It works fine var hash = window.location.hash; var index = $("#tabs a").index($('#link-'+hash.replace('#',''))); if(index&

我对jqueryui选项卡有问题

我有以下代码:

//The jQuery Tabs
$( "#tabs" ).tabs();

//Code to open the correct tab if i write the hash on the url. It works fine
var hash = window.location.hash;
var index = $("#tabs a").index($('#link-'+hash.replace('#','')));
if(index>=0) $("#tabs a").eq(index).click();
如果我不在页面中输入base href=…我可以用鼠标右键打开新页面中的选项卡,页面将在选择正确选项卡的情况下打开

如果在使用鼠标右键打开新窗口中的选项卡时,将我的页面放入我的页面base href=http://$\u服务器['http\u HOST']/,则打开的页面不正确。只得到页面的底部,失去大部分url


请帮忙。对不起,我的英语不懂

如果我在我的页面中输入/“/>

比特

但我认为最后两行可能已经缩减为一行:

$('#link-'+hash.replace('#','')).click();

最后两行从url中获取哈希值并打开正确的选项卡。这不是问题。问题是,当我在新页面中打开选项卡时,链接丢失。你说的页面基础是什么意思?也许一个在线小示例可以帮助我理解(jsFiddle);)