Solved

Delay function in JavaScript

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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jsp insert to database example 2 89
CSV file parsing thru Java 13 54
passing enum to a method 4 51
Pass multiple values or string arrays in java as a parameter 3 73
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…
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 will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

739 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