私はjqueryダイアログを使用していますが、実装したいのは、ユーザーが「OK」を押したときにプログラミングが続行し、「キャンセル」を押したときに停止したことです。
function displaymessage()
{
$("#confirm").dialog({
buttons:{
"OK":function(){$(this).dialog("close"); test(1);},
"Cancel":function(){$(this).dialog("close");test(0);}
}
});
function test(bool)
{
if(bool==1)
return true;
else return false;
}
return test();
}
<div id="confirm"></div>
<input type="button" value="Click me!" onclick="return displaymessage()" />
しかし、ユーザーが「OK」ボタンをクリックした後に機能テストの実行を制御する方法は?
ありがとう
</p>