我在触发功能时遇到问题。我有以下代码:
var dnfmomd;
dnfmomd = new function () {
//function content
}
$("#launch_button").on("click", dnfmomd.init);
答案 0 :(得分:0)
您尝试过吗?
var dnfmomd = function () {
//function content
}
$("#launch_button").on("click", dnfmomd());
答案 1 :(得分:0)
我建议这样做
var dnfmomd = function() {
//function content
}
$("#launch_button").on("click", function() {
dnfmomd();
});