Solved

Delay function in JavaScript

Posted on 2000-04-06
5
2,062 Views
Last Modified: 2010-05-18
Simple question (I've never used JavaScript before) - is there a function in JavaScript to pause a set number of seconds (rather than using a loop to delay) ? And if so what is it ?
0
Comment
Question by:paulstamp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Expert Comment

by:coopa
ID: 2690150

You can do this with HTML
not JavaScript, but HTML:

<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="01 Jan 1970 00:00:01 GMT">

0
 
LVL 2

Expert Comment

by:coopa
ID: 2690161
coopa changed the proposed answer to a comment
0
 
LVL 3

Author Comment

by:paulstamp
ID: 2690164
Rich ?

What's that got to do with Delay ? That looks like something to do with cacheing.
0
 
LVL 2

Accepted Solution

by:
coopa earned 50 total points
ID: 2690171
WHOOPS... WRONG QUESTION.... !   DOH!

Yeah have the answer anyway:

function Delay(){
 setTimeout("dothis()",100);
}

function dothis(){
  // place your code in here
}

0
 
LVL 3

Author Comment

by:paulstamp
ID: 2690180
Thanks... two answers for the price of one !
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question