ui.tabs don't work if dynamically added in IE7
Hi guys, today I found a very strange behavior of ui.tabs while using
IE7. I'm dynamically insert parts of web page loaded using AJAX, and I
wasn't able to get tabs working correctly (even though all other
browser where perfectly OK).
And than I saw it. When dynamically adding markup to page IE handles
specifically <a href="#..."> tags. It adds location.href before the
'#' hash sign. So all tabs do look like <a href="http://my.page.com/
#..."> once inserted into the page and everything gets messed up.
I put in a small fix to handle this, but probably it would need some
more investigation in all other UI widgets which are counting on <a
href="#..."> tags.
My fix is in _tabify() function in ui.tabs.js file just before testing
(fragmentId.test(href))
if ($.browser.msie) {
// IE7 - detect location prefix and remove it
// when appending content dynamically, IE7 adds location prefix to
// #.+ links, making them impossible to be used as tabs
var location_index = href.indexOf(location_href);
if (location_index == 0) {
href = href.substr(location_href_len);
$(a).attr('href', href);
}
}