Forum Moderators: open

Message Too Old, No Replies

problems when get nodeValue by Firefox . Help me plzz!

         

minhlt

2:44 am on Sep 15, 2006 (gmt 0)

10+ Year Member



I got some problems when get nodeValue by Firefox (myParentNode.childNodes[i].firstChild.nodeValue), incase node's length is longer than 4096 I can't get it's content ,and return value is a string with length is 4096.Everything will be okie if it's used on IE. Please give your ideas about this.Thanks

penders

4:32 pm on Sep 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Blimey, yeah! There seems to be a limit in FF (IE and Opera Ok) - the (firstChilds) node's length is being truncated to 4096 when it is above a certain size... although the node's size can actually go up to 8191 before it is truncated down to 4096.

Actually, on closer inspection, what appears to be happening is that FF is spliting the 'big' node into smaller childNodes!

So, on the little test I did, with a single text node of (what you would expect to be) 10,831 characters. FF split it into two smaller nodes of...
[1] 4096 chars and
[2] 6735 chars

Hhhmmm... why?!

... and welcome to WebmasterWorld!

penders

9:48 pm on Sep 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have since read that Opera also has a maximum (text) node size, but a much larger 32 KB - so Opera will split into smaller nodes if needed too.