Automatic return after 1.3 seconds
Copy Code code as follows:
<span id= "Totalsecond" >3</span> seconds to return automatically
<script language= "JavaScript" type= "Text/javascript" >
<!--
var second = document.getElementById (' Totalsecond ') . textcontent;
if (navigator.appName.indexOf ("explorer") >-1)//To determine whether IE browser or Firefox browser, take the appropriate measures to obtain the number of seconds
{
Second = Document.g Etelementbyid (' Totalsecond '). innertext;
} else
{
Second = document.getElementById (' Totalsecond '). textcontent;
}
SetInterval ("redirect ()", 1000);//Every 1 seconds the redirect () method is invoked once
function redirect ()
{
if (second ; 0
{
Location.href = ' http://www.baidu.com ';
} else
{
if (navigator.appName.indexOf ("explorer") >-1)
{
document.getElementById (' Totalse Cond '). innertext = second--;
} else
{
document.getElementById (' Totalsecond '). textcontent = second--;
}
}
}
-->
</script>