Opened 10 years ago
Closed 10 years ago
#13462 closed bug (duplicate)
Problem with append in 1.9.1
Reported by: | nhuon | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | manipulation | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
There seems to be a problem with chaining elements when I do the following:
$(".a").append($("<div>B</div>").after("<span>C</span>"));
C is not inserted after B like I would expect. This was working with 1.8.3, but not anymore in 1.9.1
Change History (1)
comment:1 Changed 10 years ago by
Component: | unfiled → manipulation |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Duplicate of #12982.
Per the 1.9 upgrade guide,
.before
,.after
, and.replaceWith
no longer have any effect when executed against collections consisting only of disconnected nodes.The old behavior of
.after
on disconnected nodes (altering the jQuery collection instead of the DOM) is still available with.add
, but it looks like your intended results can be achieved without either: http://jsfiddle.net/gfGyR/1/