Nate's Programming Blog

Just wanted to let everyone know I discovered a bug with firefox/Mozilla/Netscape/Opera today. It seems that if you try to create a text node using javascript DOM that is over 4096 bytes, it will break the text node into multiple text nodes of 4096 bytes or less. If you want to reconstruct the text, you will need to loop over all the text nodes and join the content together again. I ran into this problem where I was writing an ajax call to a controller that read the current application log file and passed the contents back in xml format. I then used javascript to parse the contents and display them on the page. IE displayed the entire contents fine, but Firefox seemed to be truncating the content. After researching I found that firefox was just splitting the content into multiple text nodes. Therefore after looping over all text nodes I was able to reconstruct the full log file and write it to the browser.


Name (required)

Email (required)

Website

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Feel free to leave a comment

top