標籤:http io 使用 java ar div 2014 問題 cti
JQuery UI中的Tabs與base元素衝突的BUG
以前一直使用jquery-ui-1.8,最近打算試一下目前最新的版本1.11。但對於Tabs,頁面是亂的,怎麼也不正常。折騰了好幾個小時,最後發現頁面中使用的base元素,對Tabs有破壞性的影響。
沒有想清楚具體的原因,先記下來再說吧。
到了晚上,又想起這個問題。這個問題實在討厭,我的系統中所有頁面中都使用了base元素,不解決這個衝突實在是不爽。經過幾個小時的跟蹤調試,終於發現的問題所在:
新版本的jquery UI中,Tabs的代碼存在一處錯誤,注意代碼片斷的第22行。
_isLocal: (function() {var rhash = /#.*$/;return function( anchor ) {var anchorUrl, locationUrl;// support: IE7// IE7 doesn‘t normalize the href property when set via script (#9317)anchor = anchor.cloneNode( false );anchorUrl = anchor.href.replace( rhash, "" );locationUrl = location.href.replace( rhash, "" );// decoding may throw an error if the URL isn‘t UTF-8 (#9518)try {anchorUrl = decodeURIComponent( anchorUrl );} catch ( error ) {}try {locationUrl = decodeURIComponent( locationUrl );} catch ( error ) {}return anchor.hash.length > 1 || anchorUrl === locationUrl;//原來為&&};
發現這個BUG很興奮,專門註冊了個帳號,去jquery UI的論壇上發了個BUG報告文章。
JQuery UI中的Tabs與base元素摩擦的BUG