X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=0ff52fa51cae7c27a954e1a517ac1f0137876b75;hb=e647a8a1f63864aa350e8c24926170d0fdff653c;hp=1d0d281339910d9b832d65fef9a8438536429cda;hpb=b9a8e65576615974228e493155c8c85dc25f09d8;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 1d0d281..0ff52fa 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -565,7 +565,7 @@ jQuery.fn = jQuery.prototype = { * @cat DOM/Attributes */ text: function(e) { - if ( typeof e == "string" ) + if ( typeof e != "object" && e != null ) return this.empty().append( document.createTextNode( e ) ); var t = ""; @@ -811,7 +811,7 @@ jQuery.fn = jQuery.prototype = { /** * Searches for all elements that match the specified expression. - + * * This method is a good way to find additional descendant * elements with which to process. * @@ -1171,9 +1171,14 @@ jQuery.fn = jQuery.prototype = { obj = this.getElementsByTagName("tbody")[0] || this.appendChild(document.createElement("tbody")); jQuery.each( a, function(){ - fn.apply( obj, [ clone ? this.cloneNode(true) : this ] ); + if ( jQuery.nodeName(this, "script") ) { + if ( this.src ) + jQuery.ajax({ url: this.src, async: false, dataType: "script" }); + else + (new Function( this.text || this.textContent || this.innerHTML || "" ))(); + } else + fn.apply( obj, [ clone ? this.cloneNode(true) : this ] ); }); - }); } }; @@ -1466,6 +1471,9 @@ jQuery.extend({ ret = c && c.getPropertyValue(prop) || ""; }); + if ( prop == "opacity" && ret == "" ) + ret = "1"; + } else if (elem.currentStyle) { var newProp = prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();}); ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; @@ -1607,7 +1615,7 @@ jQuery.extend({ * @cat JavaScript */ trim: function(t){ - return t.replace(/^\s+|\s+$/g, ""); + return (t||"").replace(/^\s+|\s+$/g, ""); }, makeArray: function( a ) { @@ -1666,11 +1674,15 @@ jQuery.extend({ unique: function(first) { var r = [], num = jQuery.mergeNum++; - for ( var i = 0, fl = first.length; i < fl; i++ ) - if ( num != first[i].mergeNum ) { - first[i].mergeNum = num; - r.push(first[i]); - } + try { + for ( var i = 0, fl = first.length; i < fl; i++ ) + if ( num != first[i].mergeNum ) { + first[i].mergeNum = num; + r.push(first[i]); + } + } catch(e) { + r = first; + } return r; }, @@ -1811,7 +1823,7 @@ new function() { // Figure out what browser is being used jQuery.browser = { - version: b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1], + version: (b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b),