How to make a function delay 5 seconds in javascript -
how make function display after 5 or 6 seconds
function a() { alert("after 5 seconds"); } a();
you can use js timers want.
settimeout/setinterval, etc.
var duration = 5000; #in ms, miliseconds. 5000 = 5s function delayedalert() { window.settimeout(slowalert, 5000); } function slowalert() { alert('that slow!'); }
look more in https://developer.mozilla.org/en-us/add-ons/code_snippets/timers
Comments
Post a Comment