jQuery ui 选项卡对我有用,但是当我在其后面放置查询字符串时,它将加载到基本 href 内容中。
也许我不理解基本 href/相对链接的正确行为。但这是我的设置:
基本链接:http://example.com/ http://example.com/ .
相对链接:random/link/example.do。
标签如下:#fragment-1。
完整链接:http://example.com/random/link/example#fragment-1 http://example.com/random/link/example#fragment-1
这就是我的链接的样子。当我在其后面放置查询字符串时,它将不起作用。就像这样:http://example.com/random/link/example?refresh=2 http://example.com/random/link/example?refresh=2
我发现了一些调整源代码的修复程序。 (link http://bugs.jqueryui.com/ticket/8851)。但是有没有办法在不调整源代码的情况下解决这个问题呢?
Thanks
嘿,这太可怕了,但你可以试试这个
$(function () {
var rquery = /\?[^#]*/;
$("#tabs").find("a").each(function() {
this.setAttribute("data-orig-href", this.href);
this.href = this.href.replace( rquery, "" );
});
$("#tabs").tabs();
});
这是一个fiddle http://jsfiddle.net/mYZF7/4/来展示它的工作原理。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)