jquery'noty'插件无法正常工作
问题描述:
当我尝试在第一个函数里面发出警报时,它刚好在 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 });
});
答
线
noty{"text":"", ..., "closeOnSelfClick":true};
应该是
noty({"text":"", ..., "closeOnSelfClick":true});
您缺少括号。
答
你应该把这个noty对象包含在pantheses中。我认为这是问题。
编辑:ninja'd ..
+0
感谢(以上代码更新)从网站,但仍然是一个问题,看贴,但尝试看看更新的代码,请 – 2012-02-19 17:14:28
刚才复制,并在此请感谢 – 2012-02-19 17:10:00