Uncaught TypeError: Cannot read property 'length' of undefined, in Chrome, joomla website, jqueryui-Collection of common programming errors

I’m using jQueryUI tabs plugin on joomla 1.5 site and I get this error in Chrome. Firefox and IE work perfectly fine. This is the part where Chrome errors out, right after anchor.hash:

(function( $, undefined ) {
    var tabId = 0,
    rhash = /#.*$/;
function getNextTabId() {
    return ++tabId;
}
function isLocal( anchor ) {
return anchor.hash.length > 1 &&
    anchor.href.replace( rhash, "" ) ===
        location.href.replace( rhash, "" )

This is a sample of HTML markup:


  • Tab 1




I read a lot of other questions regarding "Uncaught TypeError" and I presume that anchor is undefined - but I don't have a clue why this happens, and only in Chrome?