私はjavascriptの確認ボックスを避けようとしていて、そのjquery.uiダイアログボックスを試しました。
確認ボックスが true または false を返すと、残りの javascipt のみが実行されますが、この jquery.ui ダイアログでは発生しません。
これは私が試したこと、
私はいくつかのリンクを持っています
function checkit(){
var istrue = showdial("confirm");
if(istrue== true) alert("yes");
else alert("no");
}
function showdial(tStr)
{
$('<div></div>').appendTo('body')
.html('<div><h4>Are you sure..?</h4></div>')
.dialog({
title: tStr,
zIndex: 10000,
autoOpen: true,
modal: true,
buttons:{
Yes: function(){
$(this).dialog("close");
return true;
}
No: function(){
$(this).dialog("close");
return false;
}
}
});
}
上記で何か間違ったことをした場合は、修正してください。
そのはいまたはいいえボタンをクリックする前に、常に「いいえ」のみを警告します。ダイアログが値を返した後にスクリプトを実行するにはどうすればよいですか。そして、その setTimeout() 関数を使用したくありません。