Plug-in screenshot:
Purpose: To confirm whether to continue the current operation when clicking a link or button.
Plug-in code:
(function($){
$.fn.confirmer = function(options){
var defaults = {
msg:"Are you sure to delete it?"
}
var options = $.extend(defaults , options);
var control=$(this);
$(control).click(function(){return confirm(options.msg);});
};
}) (jQuery);
Usage:
1.$(".delete").confirmer();
2.$(".delete").confirmer({msg: 'Confirm deletion? '});
Example:
jquery.confirmer.js < ;meta http-equiv="Content-Type" content="text/html; char set=utf-8" />
< ;button id="btnDelete" class="delete">Delete