I’ve been having a very bizarre issue with the jQuery Confirm code on my website. I’ve been using a plugin designed by Nadia Alramli (http://nadiana.com/jquery-confirm-plugin)
This plugin stops the action of the element it is applied to, and provides a confirmation dialog first. I use this for “action buttons” on a funds application management system that I’ve developed. Everything was working fine until recently, when literally, out of the blue, the code just stopped working. The confirm dialog shows, but when you click “yes,” the button’s action doesn’t execute.
I’ve checked and re-checked the code, and nothing has been changed from the way it was originally implemented. I’ve also created an example page where I’ve removed all other unnecessary code, and I’m still having the same problem.
Here’s a link to my example page:
http://www.greeleyw2w.org/admin/example2.html
What could cause something like this? The only things I can think of are either a problem with my web host (GoDaddy), or something with the Google hosted version of jQuery.
//Actions for the status change buttons
$(document).ready(function(){
$("#test").click(function(){ //The action of the button
alert("You confirmed the button click.");
});
$('.confirm').confirm({ //Captures button action, asks for confirmation.
msg:'Are you sure?',
wrapper:'<span style="color:#099"></span>',
dialogShow:'fadeIn',
dialogSpeed:'slow',
buttons: {
wrapper:'<button></button>',
separator:' '
}
});
});
It’s incompatible with JQuery 1.8.
Around line 43, change the code from:
var events = jQuery.data(target, ‘events’);
to
var events = jQuery._data(target, “events”);
The event model broke with 1.8 due to a removed api.
http://blog.jquery.com/2012/08/09/jquery-1-8-release