Thursday, April 17, 2014

the better "are you sure?" dialog

jConfirm is a jQuery plugin for dressed-up confirm stuff. There is also a jAlert. jConfirm implementations look like this:

jConfirm("Are you sure you want to do this?", "Caution", function (result) {
   if (result) {
      doWhatever();
   }
});

 
 

The first magic string is the copy in the body of the message while the second is for a header above.

No comments:

Post a Comment