element.appendTo('<td>').appendTo('<tr>').appendTo('#ordersList')
Is this supposed to put the element inside a new td element, inside a new tr element inside the #ordersList element (was a table)?
Because I was just getting the naked element inside #ordersList with no wrapping tr/td.
This old site I was trying to troubleshoot seems to be using jQuery 1.4.1 - in case this is a known bug.
appendTo()
returns the element you're operating on, so what you're actually doing is;
td
.td
and adding it to a newly created tr
.tr
and attaching it to #ordersList
What would work would be something like this;
$('<td></td>').appendTo($('<tr></tr>').appendTo('#ordersList')).append(element);
... which sucks for readability.