當我嘗試在第一個函數裏面發出警報時,它剛好在 var ajax0 = false;它沒有警報和對話框不顯示在所有即使我因爲它不存在不提醒ID,它的內部文件準備jquery'noty'插件無法正常工作
$(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 });
});
剛纔複製,並在此請感謝 – 2012-02-19 17:10:00