Bug Tracker

Opened 7 years ago

Closed 7 years ago

#13757 closed bug (notabug)

$('div').after('div').appendTo('body')

Reported by: shj@… Owned by: shj@…
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Description

http://api.jquery.com/after/

$('<div/>').after('<p></p>').addClass('foo')

.filter('p').attr('id', 'bar').html('hello')

.end() .appendTo('body');

this example no more work >=1.8

$('<div/>').add('<p></p>').addClass('foo')

.filter('p').attr('id', 'bar').html('hello')

.end() .appendTo('body');

is work.

change example or bug fix?

Change History (3)

comment:1 Changed 7 years ago by Rick Waldron

Owner: set to shj@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.

To get you started, use the appropriate boilerplate:

Open the link and click to "Fork" (in the top menu) to begin.

Also, please read:

Additional resources:

comment:2 Changed 7 years ago by shj@…

Status: pendingnew

oh,

sorry. no more work 1.9

1.8 work : http://jsfiddle.net/crucify/sAXwJ/ 1.9 not work : http://jsfiddle.net/crucify/Ra3gE/ 1.9 modify for work (after -> add) : http://jsfiddle.net/crucify/BZhJD/

http://api.jquery.com/after/ jQuery document's example. "The result is a jQuery set containing a div and a paragraph, in that order. That set can be further manipulated, even before it is inserted in the document."

comment:3 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

As far as the docs go it's one of the unchecked boxes in this ticket.

https://github.com/jquery/api.jquery.com/issues/240

Sorry about the delay.

Note: See TracTickets for help on using tickets.