0
我有這個mootools代碼,點擊一個按鈕刪除記錄,現在我想要當用戶單擊刪除按鈕確認對話框彈出問我是否確定我想刪除記錄的答案是和不。 ..這裏是我的代碼...如果用戶回答是繼續這個請求,如果他回答沒有不繼續,這將是很大,如果我有另一條消息說,他點擊後是刪除記錄是...確認刪除?
<script>
window.addEvent('domready',function() {
$$('a.delete').each(function(el) {
el.addEvent('click',function(e) {
e.stop();
var parent = el.getParent('div');
var request = new Request({
url: '/delete.php',
link: 'chain',
method: 'get',
data: {
'delete': parent.get('id').replace('record-',''),
ajax: 1
},
onRequest: function() {
new Fx.Tween(parent,{
duration:300
}).start('background-color', '#fb6c6c');
},
onSuccess: function() {
new Fx.Slide(parent,{
duration:300,
onComplete: function() {
parent.dispose();
}
}).slideOut();
}
}).send();
});
});
});
</script>