العودة تلقائيا بعد 1.3 ثانية
نسخة الكود كما يلي:
<span id = "totalsecond"> 3 </span> إرجاع تلقائيًا بعد 3 ثوانٍ
<script language = "javaScript" type = "text/javaScript">
<!-
var second = document.getElementById ('TotalSecond'). TextContent ؛
if (navigator.appname.indexof ("explorer")> -1)
{
الثانية = document.getElementById ('totalsecond'). innertext ؛
} آخر
{
الثانية = document.getElementById ('totalsecond'). textContent ؛
}
SetInterval ("Redirect ()" ، 1000) ؛
إعادة توجيه الوظيفة ()
{
إذا (الثاني <0)
{
location.href = 'http://www.baidu.com' ؛
} آخر
{
if (navigator.appname.indexof ("explorer")> -1)
{
document.getElementById ('totalsecond'). innertext = second-- ؛
} آخر
{
document.getElementById ('totalsecond'). textContent = second-- ؛
}
}
}
->
</script>