Home >Web Front-end >JS Tutorial >JS method to implement a dialog box that pops up every 3 seconds on a web page_javascript skills

JS method to implement a dialog box that pops up every 3 seconds on a web page_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:33:142171browse

The example in this article describes how JS implements a dialog box that pops up every 3 seconds on a web page. Share it with everyone for your reference, the details are as follows:

The screenshot of the running effect is as follows:

The online demo address is as follows:

http://demo.jb51.net/js/2015/js-3-sec-alert-dlg-codes/

The specific code is as follows:

<html>
<head>
<title>每隔3秒弹出对话框</title>
</head>
<body>
不要以为这是个空网页,一会就有东西弹出来~
<script language="javascript" type="text/javascript">
function time(){ 
alert("我3秒出来一次.");
}setInterval("time()",3000);
</script>
</body>
</html>

I hope this article will be helpful to everyone in JavaScript programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn