PDA

View Full Version : how can i implenent alert?



geniiyr
25 May 2007, 8:29 PM
there is a very important function in "alert()" that: when we call "alert()", the javascript program will be interrupted until we press the "ok" button, and how can i implement this function in my own function..?

thanks.......

brian.moeskau
25 May 2007, 10:46 PM
This has been discussed before in the forums. There's no way to do it directly as alert is built into the browser and works on low-level browser APIs. To simulate this, most people end up writing two parts to the code: the first part shows a JS dialog, the second part is a callback function executed after the dialog is dismissed that runs the next part of your code. There's really no way to "pause" the browser effectively.

jay@moduscreate.com
26 May 2007, 2:57 PM
Why can't you just use alert ?