Solved

Delay function in JavaScript

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
by zero exception 10 41
Java: How do I open the default windows program for a given file type 3 28
What's wrong with this code? 4 23
sql import cannot be resolved jsp 3 23
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

809 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