Call: (209) 560-6611

JavaScript Loop Script

Date: May 21, 2012 Author: ang Category: Affordable Web Design Tutorials Tags: Comments: 0

You can create a loop in JavaScript by using the 'setInterval' statement. Here's an example of an error message that will keep popping up, every four seconds.

JavaScript loop script code snippet

This script will cause an error message window to popup every four seconds or 4000 milliseconds. Simply insert this code into any HTML web page, WordPress page, WordPress post, or Facebook Page.

 Javascript |  copy code |? 
<script type="text/javascript">
// set interval
var tid = setInterval(mycode, 4000);
function mycode() {
alert('It is time to take a 30 second break and Look Around!');

Leave a Reply

Your email address will not be published. Required fields are marked *

Before you post, please prove you are sentient.

What is 3 times 6?

Before you post, please prove you are sentient.

what is 9 in addition to 9?