JQuery Ajax using Confirm, confirm Delete button onclick= "return confirm" (' Confirm delete? ');"
<script type= "Text/javascript" >
$ (function () {
$ ("#btnDelete"). Click (function () {
//var user8id = $.trim ($ (' #user8ID '). Val ());
var statu = confirm ("Are you sure to delete the current data?");
if (!statu) {return
false;
}
var operation = ' 8IDdelete ';
$.ajax ({
type: ' POST ',
URL: ' backendusermodulemapping.php?stamp= ' +new Date (). GetTime (),
data: ' Operation= ' +operation+ ' & ' +$ ("form"). EQ (1). Serialize (),
success:function (msg) {
if (msg = 1) {
Alert (' Delete successful! ');
Location.reload ();
} else{
alert (' delete failed! ');
}
,
error:function () {
alert (' delete failed! ');
}
);
});
});
</script>
The above is a small series for everyone to bring jquery Ajax in the use of confirm, to confirm whether the deletion of the simple instance of the entire content, I hope that we support the cloud-Habitat Community ~