jQuery + Ajax + Script error

22 views
Skip to first unread message

Trey

unread,
Jul 12, 2010, 7:25:59 PM7/12/10
to boxy
Well, the result isn't an error but Boxy does seem to throw away my
script tags. After much debugging I found the culprit to be in
setContent()

jQuery separates the script tags passed back in ajax and puts them at
the end. The content array it returns is an array with the first
element being the HTML returned from ajax and the 2nd element being
the script tag.

Line 369ish:

this.getInner().append(newContent);

Only seems to apply the first element. While my patch:

var inner = this.getInner();
for (var i=0; i<newContent.length; i++) {
inner.append(newContent[i]);
}

applies all the elements.

Thoughts?
Reply all
Reply to author
Forward
0 new messages