InnerText is used in the original webpage. Here, innerHTML is replaced by innerHTML to support firefox. Because firefox does not support innerText, but there is already a way for firefox to support innerText. The compatible code is as follows.
Copy codeThe Code is as follows:
// Enable Mozilla to support innerText
Try {
HTMLElement. prototype. _ defineGetter __
(
"InnerText ",
Function ()
{
Var anyString = "";
Var childS = this. childNodes;
For (var I = 0; I <childS. length; I ++)
{
If (childS [I]. nodeType = 1)
AnyString + = childS [I]. tagName = "BR "? '\ N': childS [I]. innerText;
Else if (childS [I]. nodeType = 3)
AnyString + = childS [I]. nodeValue;
}
Return anyString;
}
);
}
Catch (e ){}
The following code is implemented using innerHTML. For more information, you can test the time-based relationship on your own.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml" xml: lang = "zh-cn"> <pead> </pead> <body> loading data ...... </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]