The original page used is innertext, cloud habitat here to replace the innerHTML is to simply support Firefox, because Firefox does not support innertext, but there are ways to let Firefox support InnerText, compatible with the code below.
Copy Code code as follows:
Let Mozilla 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) {}
Following the use of innerHTML implementation of the code, and other more places, we have to test their own time relationship, not to say more.
<! 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> < Div id= "Blogtitle" > Data loading ......</div> <script language= "JavaScript" > jb51titles = new Array (' ideal of life, Just for the sake of the ideal life ', ' play your part well, do what you have to do ', ' the cloud-dwelling community-www.jb51.net ', ' The truth of life is just hidden in bland ', ' imagination is more important than knowledge ', ' every trauma is a mature ', ' passion is a prerequisite for success!! ' , ' Remember what you should visit, forget who you forget ', ' learn more, the more you find yourself ignorant ', ' everything has a price, the price of happiness is pain ', ' work is a pleasure ', ' love, the original is a smile drink poisoned wine ', ' Young is infinite possibility ', ' pursuit of self breakthrough ', ' remember the Forget what should be forgotten ', ' just start, though it's not too late! ' There are things in themselves that we can't control and have to control ourselves. ', ' experience is taken out of pain, ' ' The hope of tomorrow, let us forget today's pain ', ' glow is not the sun's patent, you can also glow ', ' You can use love to get the world, you can also use hate to lose the world ', ' Young is the only time we have the right to weave dreams ', ' the value of people, In the moment of temptation to be decided ', ' Learn to be lazy, and lazy out of the realm is to improve the efficiency of the most effective way! ', ' a little less preset expectations, the care of people will be more comfortable ', ' as long as people do not lose direction, will not lose their own '); TitleID = Math.floor (Math.random () *jb51titles.length); document.getElementById ("Blogtitle"). InnerHTML =jb51titles[titleid]; </script> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]