jQuery ui 选项卡对我有用,但是当我在它后面放置一个查询字符串时,它会加载基本 href 内容。
也许我不理解基本 href/相对链接的正确行为。但这是我的设置:
基地 href:http://example.com/ .
相关链接:random/link/example.do.
Hastag like so: #fragment-1 .
完整链接:http://example.com/random/link/example#fragment-1
这就是我的链接的样子。当我在它后面放一个查询字符串时,它不起作用。像这样: http://example.com/random/link/example?refresh=2
我发现了一些调整源代码的修复。 (link)。但是有没有办法在不调整源代码的情况下解决这个问题?
谢谢
最佳答案
嘿,这太可怕了,但你可以试试这个
$(function () {
var rquery = /\?[^#]*/;
$("#tabs").find("a").each(function() {
this.setAttribute("data-orig-href", this.href);
this.href = this.href.replace( rquery, "" );
});
$("#tabs").tabs();
});
这是一个 fiddle展示它的工作。
关于javascript - 带有基本 href 和查询字符串的 jQuery ui 选项卡不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19025765/