javascript - jQuery 1.8.0 - appendTo() does not work in IE8 -
i have <table> <thead> , <tbody>. in $(document).ready() have function targeting <tbody> , make ajax call servlet. resulting json inserted tbody row-by-row , cell-by-cell.
the following code fragment.
var tbody = $('#topten'); $.each(responsejson, function(i, obj) { var trkey = $('<tr>'); trkey.appendto(tbody); $.each(obj, function(k, v) { if (k == 'abc') { var td = $('<td>'); td.appendto(trkey); } }); }); i got following exception ie8 console:
script65535: unexpected call method or property access. jquery-1.8.0.js, line 5565 character 5 which happens
this.appendchild( elem ); my app works in ie9,10 ff, chrome...but not ie8.
may ask if there's work around issue?
thanks
edit: realized input box appendto() td caused problem, code fragment fine. question closed. apologize.
fyi: ie8, ie7 , ie6 not allow modification element, including .append() , .appendto() because not considered standard or correct dom elements, , hence treated text. make sure close elements such <div></div><a></a>, etc. older browsers can tell trying do.
description:
.appendto() works great if pass dom element created new window. fail if created original window (html string or created $() before).
Comments
Post a Comment