Skip to content
Permalink
Browse files
Revert the changes from 65ebf57, they were ineffectual against IE's i…
…nsanity: http://ejohn.org/files/bugs/fragment/ Used a different tactic instead (just don't return a fragment from .parent()). Fixes #5638.
  • Loading branch information
jeresig committed Dec 17, 2009
1 parent ba86cc0 commit ed5731d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
@@ -53,7 +53,7 @@ var jQuery = function( selector, context ) {

jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
var match, elem, ret, doc, parent;
var match, elem, ret, doc;

// Handle $(""), $(null), or $(undefined)
if ( !selector ) {
@@ -88,12 +88,7 @@ jQuery.fn = jQuery.prototype = {

} else {
ret = buildFragment( [ match[1] ], [ doc ] );
parent = ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment;
selector = [];

while ( parent.firstChild ) {
selector.push( parent.removeChild( parent.firstChild ) );
}
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}

// HANDLE: $("#id")
@@ -161,7 +161,7 @@ jQuery.fn.extend({
});

jQuery.each({
parent: function(elem){return elem.parentNode;},
parent: function(elem){var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null;},
parents: function(elem){return jQuery.dir(elem,"parentNode");},
parentsUntil: function(elem,i,until){return jQuery.dir(elem,"parentNode",until);},
next: function(elem){return jQuery.nth(elem,2,"nextSibling");},

0 comments on commit ed5731d

Please sign in to comment.