Click to See Complete Forum and Search --> : setTimeout and delay


ck_bullet
05-19-2005, 01:17 PM
i have this:

<a href="javascript:void(0)" onclick="delay()"><img src="imgname.jpg" /></a>

in the .js file i have this:

function delay(){
window.setTimeout(alert("check"), 3000);
}

so once i click the img, i would like for the alert dialog box to pop up after 3 seconds, but it appears immediately. changing the delay argument has no effect on the delay. what am i doing incorrectly here? thanks for the help.

A1ien51
05-19-2005, 02:36 PM
window.setTimeout('alert("check")', 3000);

ck_bullet
05-19-2005, 02:49 PM
ahh thanks!! that worked.