• John Resig's avatar
    A follow-up to [6578] (which stopped adding expandos to elements that didn't... · 67d445a7
    John Resig authored
    A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
    
    $("<div/>").after("<span/>")
    => [ div, span ]
    (calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)
    
    $("<div/>").before("<span/>")
    => [ span, div ]
    (calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)
    
    $("div").add("span")
    => [ div, span, span, div, span ]
    (results now come out in document order)
    
    $("div").find("code").andSelf();
    => [ div, code, code ]
    (results now come out in document order)
    
    Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().
    
    Exception: .parents() will still return the results in reverse document order.
    
    jQuery.data(elem)
    => { object of data }
    (no longer returns the unique ID assigned to the node)
    
    67d445a7
Name
Last commit
Last update
build Loading commit data...
speed Loading commit data...
src Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
ChangeLog.txt Loading commit data...
GPL-LICENSE.txt Loading commit data...
MIT-LICENSE.txt Loading commit data...
Makefile Loading commit data...
README Loading commit data...
build.xml Loading commit data...
reminder.txt Loading commit data...
version.txt Loading commit data...