Skip to content Skip to sidebar Skip to footer

How To Redirect While Prompt Is Still Active?

So say I have the following code: window.prompt('Redirecting'); location.href = '/'; (I know this isn't useful code, but wait one sec) I can't figure out how to make it so that pr

Solution 1:

You can not have a timer to close a prompt, alert, confirm, etc.

If you want to do something like that you are going to have to build something using layers in JavaScript. Look at libraries like jQuery UI dialog, YUI's, dojos, or any other library out there.

Solution 2:

How alert, prompt, etc behave is up to the browser. Mostly, they are fully modal, so they block all input. I'd suggest a framework such as FancyBox to show a popup that isn't modal and isn't under the browser's control.

Post a Comment for "How To Redirect While Prompt Is Still Active?"