「 」のようなクラスを作りたいですMessageBox
。Show()
関数を呼び出すときに、必要なパラメーターを渡します。お気に入り:
MessageBox.Show(
{
str : "Are you sure?",
onYes : function(){
//do something
},
onNo: function(){
// Do another stuff
}
});
私が試したこと:
var MessageBox = {
Show : function(){ // I stuck here
}
}
ショー内で JavaScriptconfirm()
関数が呼び出されているとします。