js跳转代码怎么延迟 window.location.href="index.html"

JavaScript09

js跳转代码怎么延迟 window.location.href="index.html",第1张

以上两种写法没有区别。

wndows是所有浏览器js对象的根对象,写的时候可以忽略。

js的所有延迟最终都是通过setTimeout来实现。

还有就是可以同setInteval实现周期调用。

var WScript = new ActiveXObject("WScript.Shell")

var key = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page"

try {

var Result = WScript.RegRead(key)

} catch( e ) {

alert(e)

}

if(Result) {

Result.toString()//就是的,不过涉及到注册表,好像是不可能的。但是既然是不可能的那当初为什么又会有这个功能呢?纠结

}

----------------------------------------------------------------

我也是在网上看的,在那看到的忘了……

location.href='url'

时间结束后加一行跳转代码

var leftsecond=parseInt((y2k.getTime()-now.getTime())/1000)

 if(leftsecond==0) document.location.href="..网站地址.."