Solved

Delay function in JavaScript

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

830 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