我正在尝试删除我单击的那个类,并且单击事件会触发并进行 ajax 调用。但它不工作。我想知道它是否可能
$(document).on('click', '.miinterest', function (event) {
event.preventDefault();
var login_id = $(this).attr('lid');
var profile_id = $(this).attr('pid');
var type = 'interest';
var dataString = "login_id=" + login_id + "&profile_id=" + profile_id + "&type=" + type;
$.ajax({
type: "POST",
url: "includes/ajax.php",
data: dataString,
success: function (html) {
$(".miinterest").addClass("disabled");
$(this).removeClass("miinterest");
$.lightbox("modules/after_message/after_message.php?page=profile&type=" + type, {
'width': 480,
'height': 240,
'autoresize': true
});
}
});
});