/ Published in: JavaScript
Expand |
Embed | Plain Text
/** * Override javascript confirm() and wrap it into a jQuery-UI Dialog box * * @depends $.getOrCreateDialog * * @param { String } the alert message * @param { String/Object } the confirm callback * @param { Object } jQuery Dialog box options */ function confirm(message, callback, options) { var defaults = { modal : true, resizable : false, buttons : { Ok: function() { $(this).dialog('close'); return (typeof callback == 'string') ? window.location.href = callback : callback(); }, Cancel: function() { $(this).dialog('close'); return false; } }, show : 'fade', hide : 'fade', minHeight : 50, dialogClass : 'modal-shadow' } $confirm = $.getOrCreateDialog('confirm'); // set message $("p", $confirm).html(message); // init dialog $confirm.dialog($.extend({}, defaults, options)); }
Comments
Subscribe to comments
You need to login to post a comment.

hi, this would be ideal for me, do you have a sample html page which shows this being called as i am having problems getting this working.
Thanks
Steve