私はJavascriptを使用しており、承認用のクラスを作成したいと考えています。
私のコードは
function Auth() {
this.action;
this.run = function() {
$("#auth-dialog-id").dialog({
width: 400,
height: 250,
modal: true,
buttons: {
OK: function() {
this.action();
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
});
};
}
電話
auth = new Auth();
auth.action = a;
auth.run();
}
function a() {
alert("test");
}
しかし、私はエラーがあります
オブジェクト # にはメソッド 'action' がありません
誰でも私を助けることができますか?