Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1754 How can I execute a function every 10 seconds?

irt.org | Knowledge Base | JavaScript | Window | Q1754 [ previous next ]

Q1754 How can I execute a function every 10 seconds?

Try either:

<html>

<head>

<script language="JavaScript"><!--
// v3 compatible:
function doSomething() {
   // do something here...
   setTimeout('doSomething()',10000);
}
//--></script>

</head<

<body onLoad="doSomething()">
...
</body>

</html>

or:

<html>

<head>

<script language="JavaScript"><!--
// v4 compatible:
function doSomething() {
  // do something here...
}

setInterval('doSomething()',10000);
//--><script>

<body>
...
</body>

</html>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.