Fix for bug #962.
[jquery.git] / src / jquery / jquery.js
index 74b912e..4874037 100644 (file)
@@ -932,10 +932,6 @@ jQuery.fn = jQuery.prototype = {
         * Please note: the expression cannot use a reference to the
         * element name. See the two examples below.
         *
-        * This will not work: $(".res img").not("img[@src$=on]")
-        *
-        * This will: $(".res img").not("[@src$=on]"); // also could be written $(".res img:not([@src$=on])")
-        *
         * @example $("p").not( $("div p.selected") )
         * @before <div><p>Hello</p><p class="selected">Hello Again</p></div>
         * @result [ <p>Hello</p> ]
@@ -1476,7 +1472,7 @@ jQuery.extend({
                                        [0,"",""];
 
                                // Go to html and back, then peel off extra wrappers
-                               div.innerHTML = wrap[1] + s + wrap[2];
+                               div.innerHTML = wrap[1] + arg + wrap[2];
                                
                                // Move to the right depth
                                while ( wrap[0]-- )
@@ -1499,7 +1495,9 @@ jQuery.extend({
                                        
                                }
                                
-                               arg = div.childNodes;
+                               arg = [];
+                               for (var i=0, l=div.childNodes.length; i<l; i++)
+                                       arg.push(div.childNodes[i]);
                        }
 
                        if ( arg.length === 0 && !jQuery.nodeName(arg, "form") )