Posted By

fengelz on 02/02/11


Tagged

javascript js setTimeout timers


Versions (?)

Setting a timer in javascript


 / Published in: JavaScript
 

  1. //The most common example you'll find
  2. setTimeout("alert('timed out');"},5000);
  3.  
  4. //The best solution as this gidevs you full flexibility using 'closure'
  5. setTimeout(function()
  6. {
  7. alert("timed out");
  8. },5000);

Report this snippet  

You need to login to post a comment.