0
我想在運行刪除功能之前顯示一個簡單的確認對話框顯示。刪除前確認(jQuery)
這裏是我迄今爲止
HTML:
<!-- Delete Confirmation Dialog Box -->
<div id="confirm" style="display:none;">
<div class="message">Are you sure you want to delete?</div>
<div class="buttons">
<div class="cancel">No</div><div class="accept">Yes</div>
</div>
</div>
<!-- Delete Button/s -->
<a href="javascript:void(0);" onclick="delete("1")"><img src="images/48x_delete.png" alt="48x_delete" width="24" height="24"/></a>
<a href="javascript:void(0);" onclick="delete("2")"><img src="images/48x_delete.png" alt="48x_delete" width="24" height="24"/></a>
...etc...
的jQuery:
function delete(id) {
fileName= 'update_db.php';
$('#response').html("<img src='images/ajax-loader.gif' border=0> Please Wait");
$.post(fileName,{postvar:1, id:id, action:'delete'}, function(res) { showStatus(res);});
}
有人能幫助我修改我的代碼以顯示對話框,確認刪除??謝謝!!!
請問你目前的解決方案不起作用有一個錯誤是,它只是沒有顯示出來 – zigdon 2010-10-07 22:25:07
你可能想改變你的按鈕'onclick'屬性被正確引用 - ?'的onclick = 「刪除( '1')」' – 2010-10-07 22:37:08