I'm attempting to modify elements and give them elements. The Table and elements are all created. However, upon attempting to load the s into the the response text strips the s. I've verified response text is propping by loading it on it's own page, however when using the below code. The tags get stripped.
$("#Records").load("get.php?"+str, function(){
$('.trclass').each(function(){
var id=this.id;
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
$('#'+id).html(xmlhttp.responseText);
}
}
xmlhttp.open("GET","get.php?Read=true&"+str2,false);
xmlhttp.send();
});
});
I've verified the responseText is correct. I'm fine with turning this into a .append() or a .load() just need something that works. I've seen solutions involving making a new div and putting a table in that and sending that back but that's way too hacky and I don't want to do that on get.php. Looking for a good solution. Hopefully from this section of code.
Thanks
I found the solution here jquery inserted HTML is rendered as a raw text
I used the answer of $('div.desc').html($.parseHTML(unescape(that_string)));
And it worked perfectly.