Js BOM 3 setTimeout/setInterval/history/loaction
2010-12-14 23:21
411 查看
1、setTimeout() //暂停指定的毫秒数后,执行指定的代码
setTimeout(要执行的代码,毫秒数)
var t= setTimeout(function(){
alert("test")
},1000) //返回值为clearTimeout的依据
clearTimeout(t); //取消
2、var t= setInterval(
function(){alert("Hello")} //在指定的时间间隔不停得执行一段代码
,1000)
clearInterval(t); //取消
3、history.back();
history.forward();
history.go(num) 1,-1等
4、location.href=url
location.replace(url) 重定向,不产生历史记录
5、navigator 浏览器信息
navigator.userAgent 返回浏览器详细信息
setTimeout(要执行的代码,毫秒数)
var t= setTimeout(function(){
alert("test")
},1000) //返回值为clearTimeout的依据
clearTimeout(t); //取消
2、var t= setInterval(
function(){alert("Hello")} //在指定的时间间隔不停得执行一段代码
,1000)
clearInterval(t); //取消
3、history.back();
history.forward();
history.go(num) 1,-1等
4、location.href=url
location.replace(url) 重定向,不产生历史记录
5、navigator 浏览器信息
navigator.userAgent 返回浏览器详细信息
相关文章推荐
- 让JavaScript中计时器setTimeout/setInterval的回调方法支持参数传递
- setTimeout and setInterval
- 中文输入法不触发keyup解决方法setInterval/setTimeout
- javascript setTimeout setInterval使用详解
- Use setInterval instead of setTimeout
- setTimeout/setInterval 第三个参数
- Javascript 调度: setTimeout and setInterval
- setTimeout/setInterval
- setTimeOut setInterval clearTimeOut
- what is the difference between the setTimeout and setInterval
- setTimeout/setInterval 传参
- 关于js setInterval setTimeout
- web.xml中的session-timeout元素与session.setMaxInactiveInterval()函数 的区别和使用
- js 多线程 setTimeout setInterval
- setTimeout/setInterval的使用和参数调用方法
- setTimeout setInterval 区别 javascript线程解释
- 【javascript基础】【setTimeout setInterval】 之 How JavaScript Timers Work [译]
- setTimeout setInterval可带参数
- javaScript知识点总结-----setTimeout setInterval 区别
- nodejs(五)同步异步--USING SETTIMEOUT INSTEAD OF SETINTERVAL TO FORCE SERIALIZATION