I’m quite new on jquery and i was looking for something that could replace the confirm dialog. I found jQuery Alert Dialogs at http://abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/#demo
but jConfirm do not return the same values as confirm().
Is possible to write a function to get the same confirm() value?
It’s about the meaning of callback function that I admit is not so clear for me 🙂
I’m quite new on jquery and i was looking for something that could replace
Share
jConfirm will never “return” anything because it’s “event driven”.
jConfirm waits until the user has made a decision and then it will call the callback function which will handle the answer. But jConfirm will not block the code execution flow like the standard
confirm(...)does.So if your previous code looks like this:
it should look like this in jQuery:
And for illustration:
The standard JavaScript confirm() execution flow
The jConfirm execution flow