Skip to content Skip to sidebar Skip to footer

How Can I Reproduce The "wait" Functionality Provided By Javascript's Confirm() Function?

I'm trying to write a custom in-window confirm dialog (based on jQuery UI) that we can use to control all aspects of the window (button text, etc). What I'd really like is for the

Solution 1:

Javascript is mostly event-based. The code reacts to events (a clicked button, a timer etc). JQuery UI also follows this paradigm. What you are trying is working against this and will be therefore quite hard if even possible. You should follow the event based approach.

It doesn't have to be much different from the code which uses confirm. If you had this:

ret = confirm("Hello User")
// do something

you could now write

aw_confirm("Hello user", "", function(ret){
  // do something
})

using an anonymous function as callback.

Post a Comment for "How Can I Reproduce The "wait" Functionality Provided By Javascript's Confirm() Function?"