I\'m receiving XML data via an AJAX call. One of the tags has a large amount of text, roughly 4000-5000 characters. In Firefox, the field is being truncated around the 3000t
@Kooilnc has it right, 4k limit on text nodes in Firefox.
You can work around it by doing this:
function getNodeText(xmlNode) {
if(!xmlNode) return '';
if(typeof(xmlNode.textContent) != "undefined") return xmlNode.textContent;
return xmlNode.firstChild.nodeValue;
}
text = getNodeText(document.getElementsByTagName("div").item(0));
alert(text.length);
See it in action here: http://jsfiddle.net/Bkemk/2/
Function borrowed from here: http://www.quirksmode.org/dom/tests/textnodesize.html