Ticket #9588 (closed bug: invalid)
appendTo behaves differently from append
|Reported by:||martijn.vanderlee@…||Owned by:||martijn.vanderlee@…|
I had a situation where HTML was rendered by jQuery. To explain, we have 2 files.
A then appends the HTML of B to the page and the function calls in B call functions in A which try to append HTML to the newly included HTML element in B;
This worked fine in JQuery 1.3.2 but since then we've upgraded to 1.6.1 in which it no longer rendered anything (according to Chrome inspector).
With 1.6.1 the following DID work however:
According to the JQuery documentation, there should be no difference between the two statements, but there is.
It almost seems like the appendTo('#imagesList') selector is evaluated at load-time (in this case, before the element is in DOM) and $('#imagesList') is evaluated at run-time. But this is just uneducated speculation.
Confirmed in Chrome 12, FireFox 3, Safari and MSIE 8 and 9.