Side navigation
#7303 closed bug (invalid)
Opened October 25, 2010 08:08AM UTC
Closed October 25, 2010 09:19PM UTC
Last modified November 02, 2010 02:14AM UTC
Regression: Cannot use appendTo() with a jQuery object that holds many elements
Reported by: | petri.lehtinen@inoi.fi | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | unfiled | Version: | 1.4.3 |
Keywords: | appendto object | Cc: | |
Blocked by: | Blocking: |
Description
I have a jQuery object to which I push two elements. Then I use .appendTo() to append these elements into another element. This works in 1.4.2 but not in 1.4.3.
Here's an example:
<!doctype html> <html> <head> <title>jQuery test</title> <!-- use 1.4.2 if you want to see it work --> <script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> </head> <body> <div id="target"></span> <script> (function() { var container = $(); container.push($('<span>foo</span>')); container.push($('<span>bar</span>')); container.appendTo($('#target')) })(); </script> </body> </html>
Attachments (0)
Change History (6)
Changed October 25, 2010 08:10AM UTC by comment:1
Changed October 25, 2010 08:17AM UTC by comment:2
The fiddle: http://jsfiddle.net/Ajxbu/
Changed October 25, 2010 02:38PM UTC by comment:3
keywords: | → appendto object |
---|---|
priority: | undecided → low |
status: | new → open |
There are much simpler ways this problem could be coded, but I've tested your original code out in 1.4.3 (and our latest version from Git) and it does indeed appear to be broken with both. Opening as a valid ticket and flagging for further review.
Changed October 25, 2010 02:42PM UTC by comment:4
keywords: | appendto object → appendto object needsreview |
---|
Changed October 25, 2010 09:19PM UTC by comment:5
resolution: | → invalid |
---|---|
status: | open → closed |
A jQuery object should contain an array of DOM elements, not other jQuery objects. Also, there has never been a documented method
.pushon a jQuery object.
Changed November 02, 2010 02:14AM UTC by comment:6
keywords: | appendto object needsreview → appendto object |
---|
Sorry about pasting code to the ticket. This is my first ticket and I only found out after posting that jsFiddle is preferred.