【发布时间】:2015-08-26 05:48:21
【问题描述】:
我正在使用 javascript 警报库 sweetalert
我的代码是:
function foo(id) {
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
}
如何将id 从foo() 函数传递到swal 中的回调函数?
【问题讨论】:
标签: javascript callback