请检查以下代码:
我不想alert('End');
在确认确认对话框之前执行。
<link href="http://labs.abeautifulsite.net/archived/jquery-alerts/demo/jquery.alerts.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="http://labs.abeautifulsite.net/archived/jquery-alerts/demo/jquery.alerts.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$("#confirm_button").click( function() {
alert('Start');
jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
if(r){alert('Ok');}else{alert('Cancel');}
});
alert('End');
});
});
</script>
<fieldset>
<legend>Confirm</legend>
<p>
<input id="confirm_button" type="button" value="Show Confirm">
</p>
</fieldset>