The original web page uses innerText, but Script Home has replaced it with innerHTML in order to simply support firefox, because firefox does not support innerText, but there is a way to make firefox support innerText. The compatibility code is as follows.
//Let Mozilla support innerText
try{
HTMLElement.prototype.__defineGetter__
(
"innerText",
function ()
{
var anyString = "";
var childS = this.childNodes;
for(var i=0; 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 places, you can test it by yourself Due to time constraints, I won’t say more.
]
Statement: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