X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=965c2798abd538cea0d493bceb2fbc1c4d94dc85;hb=2e544e9eb89c87b9eac6df445474d21e9be604eb;hp=d8d2564b9b593936bfa5679680629cb931fe9b45;hpb=dde208fc4b60aa183899687ec071a6c31556ead2;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index d8d2564..965c279 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -50,8 +50,10 @@ jQuery = function(a,c) { return new jQuery(a,c); // Handle HTML strings - var m = /^[^<]*(<.+>)[^>]*$/.exec(a); - if ( m ) a = jQuery.clean( [ m[1] ] ); + if (typeof a == "string") { + var m = /^[^<]*(<.+>)[^>]*$/.exec(a); + if ( m ) a = jQuery.clean( [ m[1] ] ); + } // Watch for when an array is passed in this.get( a.constructor == Array || a.length && !a.nodeType && a[0] != undefined && a[0].nodeType ? @@ -446,6 +448,17 @@ jQuery.fn = jQuery.prototype = { * $("#check2").attr('checked', false); * ok( document.getElementById('check2').checked == false, 'Set checked attribute' ); * + * @test stop(); + * $.get('data/dashboard.xml', function(xml) { + * var titles = []; + * $('tab', xml).each(function() { + * titles.push($(this).attr('title')); + * }); + * ok( titles[0] == 'Location', 'attr() in XML context: Check first title' ); + * ok( titles[1] == 'Users', 'attr() in XML context: Check second title' ); + * start(); + * }); + * * @name attr * @type jQuery * @param String key The name of the property to set. @@ -1558,7 +1571,7 @@ jQuery.extend({ empty: "!a.childNodes.length", // Text Check - contains: "(a.innerText||a.innerHTML).indexOf(m[3])>=0", + contains: "((a.firstChild && a.firstChild.nodeValue)||a.innerText||a.innerHTML).indexOf(m[3])>=0", // Visibility visible: "a.type!='hidden'&&jQuery.css(a,'display')!='none'&&jQuery.css(a,'visibility')!='hidden'", @@ -1828,7 +1841,7 @@ jQuery.extend({ "for": "htmlFor", "class": "className", "float": jQuery.browser.msie ? "styleFloat" : "cssFloat", - cssFloat: fix["float"], + cssFloat: jQuery.browser.msie ? "styleFloat" : "cssFloat", innerHTML: "innerHTML", className: "className", value: "value",