Closed extrakun closed 10 years ago
Code:
Start with an empty div (and only div in the page)
var a = $.make('<p>hello world</p> <p>hello word again!</p>') $('div").insert(a); // or $(div).append(a);
Only the first node will be added to the div
Did some tracing,think it's related to line 758 in chocolatechip-3.0.6.js:
this.each(function(node, idx) { __insert(node, cnt[idx], position); });
the this in the line refers to that of the container being inserted to, rather than the array of nodes that is being inserted. Tried changing this to cnt but no luck, got an error "trying to insert a node where it doesn't belong"
this
cnt
Thanks, that is a serious bug. I'll give that high priority today.
This has been addressed in commit c0ad390624 The [].insert method now properly injects arrays of elements into the target elements.
Code:
Start with an empty div (and only div in the page)
Only the first node will be added to the div
Did some tracing,think it's related to line 758 in chocolatechip-3.0.6.js:
the
this
in the line refers to that of the container being inserted to, rather than the array of nodes that is being inserted. Tried changingthis
tocnt
but no luck, got an error "trying to insert a node where it doesn't belong"