Home > Web Front-end > JS Tutorial > body text

Problems with textNode fragmentation in FireFox_javascript skills

WBOY
Release: 2016-05-16 19:15:18
Original
1072 people have browsed it

A very common behavior in Ajax applications is to wrap the data in XML in the background and return it to the browser. The browser parses the XML and gets nodeValue

. If the content in a single node is very long (more than 4096 bytes), then Please note that in FireFox/Mozilla, the content will be decomposed into multiple textNodes by FrieFox, each with a size of 4096 bytes. This situation can be handled with the following functions (IE compatible)

Copy code The code is as follows:

function getNodeValue(node)
{
if(node ​​&& node.hasChildNodes()){
//return node.firstChild.nodeValue; var s=""
                         /Mozilla has many textnodes with a size of 4096
//chars each instead of one large one.
//They all need to be concatenated. for(var j=0;j                                                                                                                                                                                                                                                                                                    >}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!