when i try to alert the id after inside the first function which is just above
var ajax0 = false; it doesn’t alert and the dialog box doesn’t show at all even if i don’t alert the id as it doesn’t exist and it’s inside document ready
$(document).on("click","a.del_cart",function(){
var id = $(this).attr("title");
noty({ text: 'product will be deleted',"modal":"true","layout":"center", buttons: [{type: 'button green', text: 'Ok', click: function() {
var ajax0 = false;
ajax0 = new XMLHttpRequest();
var qst0 = "?id="+id;
ajax0.open("POST","ajax/del_product.php"+qst0);
noty({"text":"cancelled successfully.","layout":"center","type":"success","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"modal":"true","animateClose":{"height":"toggle"},"speed":"500","timeout":"2000","closable":true,"closeOnSelfClick":true});
$(".cart").fadeOut(100,function(){
display_cart();
$(".cart").fadeIn(2000);
});
ajax0.send(null);
} }, {type: 'button pink',text: 'Cancel', click: function() { /**/ } }],closable: false,timeout: false });
});
The line
Should be
You are missing parentheses.