Hi,
I have a problem with Internet Explorer browser while reading the contents of the DIV element using jQuery('DIVID').html() method. I insert a simple XML string to the DIV element. But when I try to read the content back using jQuery, some of the data is missing. It works fine in Firefox.
My code looks as shown below.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
<p><div id="AJAXTESTDATA"></div>jQuery Simple Test.</p>
<script>
var testAjax = document.getElementById("AJAXTESTDATA");
var tes = '<SPAN id="tt"><DATA1><DATA2><DATA3><SPAN id="doc">TEST</SPAN></DATA3></DATA2></DATA1></SPAN>';
alert("Actual Data:"+tes);
testAjax.innerHTML = tes;
var cbkData = jQuery('#AJAXTESTDATA').html();
alert("Data after inserting to DIV:"+cbkData);
</script>
</body>
</html>
Edit:
The second alert message will display the contents of the DIV tag as below:
Data after inserting to DIV: <SPAN id=test><SPAN id=doccase>TEST</SPAN></DATA3></DATA2></DATA1></SPAN>
So you can see that most of the start tags are missing! So whatever tag names I use, the same is the result in IE.
Could anyone let me know the reason behind the truncation of data while reading via IE?
Kind Regards, Krishna.