Solved

Delay function in JavaScript

Posted on 2000-04-06
5
2,053 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now