Total members 11890 |It is currently Wed Apr 24, 2024 2:47 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Timeout after fours seconds in javascript
javascript code
<html>
<head>
<title>Sleep in Javascript</title>


<script>
function fun1() {

setTimeout('fun2()', 4000);
}
function fun2() {
alert('After Sleeping to 4 seconds');

}
</script>
<style type="text/css">
div#divMe
{
font-weight:bold;
background:#0000C0;
visibility:visible;
text-align:center;
text-decoration: underline;
color:Yellow;
}
</style>

</head>

<body>
<input type="button" onclick="fun1()" value="Sleep" />
<div id="divMe">
<p>Sleep for sometime in Javascript</p>
</div>
</body>
</html>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Sleep in Javascript
 javascript help with BMI     -  
 i need help in javascript     -  
 Javascript     -  
 When to use javascript?     -  
 need help in javascript     -  
 using javascript     -  
 need help with javascript     -  
 what is javascript ?     -  
 JavaScript     -  
 JavaScript array_map     -  



Topic Tags

JavaScript Functions
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com