Replacing tbody with html
I am trying to replace the content in the "tbody" of a table with new HTML via AJAX. I have confirmed that the AJAX response has valid HTML in it, and it continues to have the appropriate HTML tags until the time that I replace the content:
$("#"+ divToReplace).html(decode64($(xml).find('content').text()));
INFO:::
"divToReplace" becomes "logsData", which is the ID of the tbody tag. decode64() simply decodes the HTML which was base64-encoded. Running Firebug, I can see that $("#logsData").html() contains HTML. If I place the returned HTML into a variable like this:
var decodedData = decode64($(xml).find('content').text());
I can put it into an alert() and it'll show all the HTML stuff. As SOON as I do the .html() call, all the HTML gets stripped out.
I've done something similar before, but I would just replace the entire table (lazy solution vs. adding new columns & stripping that # of columns from the end, just like now). I can't figure out why the HTML tags get stripped out. I have been searching for solutions all over the web, but most everything I've found involves appending data into a tbody, or manipulating the data within the tbody.
Any suggestions (or solutions) would be greatly appreciated!