X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=17e2a66a13568bce478d130c2bbc4d24e5111cb0;hb=fa2aaf27c29769ca6611a77889321443db47e8e0;hp=c3185bb5331c38080dbfd6dbed597f082bf13cf7;hpb=df11c1b76c8a0213be031d23d81e10ec4c28e658;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index c3185bb..17e2a66 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1171,7 +1171,7 @@ jQuery.fn = jQuery.prototype = { return this.each(function(){ var obj = this; - if ( table && this.nodeName == "TABLE" && a[0].nodeName != "THEAD" ) { + if ( table && this.nodeName.toUpperCase() == "TABLE" && a[0].nodeName.toUpperCase() != "THEAD" ) { var tbody = this.getElementsByTagName("tbody"); if ( !tbody.length ) { @@ -1218,7 +1218,20 @@ jQuery.fn = jQuery.prototype = { }; /** - * + * Extends the jQuery object itself. Can be used to add both static + * functions and plugin methods. + * + * @example $.fn.extend({ + * check: function() { + * this.each(function() { this.checked = true; }); + * ), + * uncheck: function() { + * this.each(function() { this.checked = false; }); + * } + * }); + * $("input[@type=checkbox]").check(); + * $("input[@type=radio]").uncheck(); + * @desc Adds two plugin methods. * * @private * @name extend @@ -1903,15 +1916,17 @@ jQuery.extend({ */ sibling: function(elem, pos, not) { var elems = []; - - var siblings = elem.parentNode.childNodes; - for ( var i = 0; i < siblings.length; i++ ) { - if ( not === true && siblings[i] == elem ) continue; - - if ( siblings[i].nodeType == 1 ) - elems.push( siblings[i] ); - if ( siblings[i] == elem ) - elems.n = elems.length - 1; + + if(elem) { + var siblings = elem.parentNode.childNodes; + for ( var i = 0; i < siblings.length; i++ ) { + if ( not === true && siblings[i] == elem ) continue; + + if ( siblings[i].nodeType == 1 ) + elems.push( siblings[i] ); + if ( siblings[i] == elem ) + elems.n = elems.length - 1; + } } return jQuery.extend( elems, { @@ -2967,7 +2982,7 @@ jQuery.macros = { * @param String expr An expression to filter the sibling Elements with * @cat DOM/Traversing */ - siblings: jQuery.sibling, + siblings: "jQuery.sibling(a, null, true)", /**