惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
雷峰网
雷峰网
WordPress大学
WordPress大学
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Engineering at Meta
Engineering at Meta
Security Latest
Security Latest
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
F
Full Disclosure
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Exploit Database - CXSecurity.com
J
Java Code Geeks
U
Unit 42
C
Cyber Attacks, Cyber Crime and Cyber Security
V
V2EX
C
Cisco Blogs
博客园 - 司徒正美
Project Zero
Project Zero
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
Scott Helme
Scott Helme
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
S
Securelist
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
G
GRAHAM CLULEY
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyberwarzone
Cyberwarzone
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
T
Threatpost
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
S
Security Archives - TechRepublic
博客园 - Franky
N
News | PayPal Newsroom
Simon Willison's Weblog
Simon Willison's Weblog
S
SegmentFault 最新的问题
W
WeLiveSecurity
A
Arctic Wolf
B
Blog

博客园 - 我本无名

asp.net中repeater嵌套CheckBoxList,RadioButtonList来完成投票 在不同页面之间传递参数 循环不间断显示滚动图片 解决"当前命令发生了严重错误。应放弃任何可能产生的结果。"的问题 - 我本无名 - 博客园 一个不错的,JavaScript代码,显示首页图片幻灯片效果 一个计算数值并进行排序的SQL语句 asp.net上传图片后,在图片上加入自己的背景字 - 我本无名 - 博客园 解决javascript里的中文信息是乱码的问题 javascript特效,信息滚动效果 关于水晶报表的多表显示 水晶报表的使用(VS2003+CR9) 关于“响应在此上下文中不可用” 中文VS2008中安装ASP.NET MVC框架,不显示模板 关于split中字符串的问题 OnClientClick的妙用! 一条SQL语句 如何进行软件需求分析 软件需求分析规格说明书格式 (转载)悟透JavaScript
javascript中setTimeOut 和setInterval的区别
我本无名 · 2008-07-11 · via 博客园 - 我本无名

我在使用javascript时,特别是在用ajax的时候,很多时候都在使用setTimeOut 和setInterval。一个重要的使用就是新闻列表页的记录自动更新。

etTimeout] setTimeout(表达式,延时时间) 在执行时,是在载入后延迟指定时间后,去执行一次表达式,记住,次数是一次

用setTimeout实现的自动变化显示随机数的效果:

<html> <head> <script> window.onload=sett; function sett() { document.body.innerHTML=Math.random(); setTimeout("sett()",500); } </script> </head> <body> </body> </html>

[setInterval] setInterval(表达式,交互时间) 则不一样,它从载入后,每隔指定的时间就执行一次表达式

用setInterval实现的自动变化显示随机数的效果:

<html> <head> <script> function sett() { document.body.innerHTML=Math.random(); } setInterval("sett();", 500); </script> </script> </head> <body> </body> </html>