【发布时间】:2016-11-04 00:46:25
【问题描述】:
,我正在尝试禁用实现按钮,当它被点击时......但它对我不起作用,在我的 ajax 请求的成功功能上,它必须添加从此框架禁用的类......但没有发生了,并且 ajax 请求它工作正常!!...请帮助!!
$(document).on('click', '.aprove , .disapprove', function() {
if (sesion != "") {
if ($(this).attr('class').split(' ').pop() == 'aprove_president') {
var id = $(this).closest("div .col .s6").find('input[type=hidden]').attr('id');
alert(id);
var data = {
'id_politic' : id,
'sesion' : sesion,
'status' : 1
}
$.ajax({
url: baseurl+'result/aprove',
type: 'POST',
data: data
})
.done(function() {
$(this).addClass('disabled');
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
}
else if ($(this).attr('class').split(' ').pop() == 'disapprove_president') {
}
}
else {
$('#verification').openModal();
}
});
【问题讨论】:
-
是的!而已 !!谢啦 !请发布您的答案,这样我就可以正确选择它!
标签: jquery ajax button materialize