【发布时间】:2019-01-20 18:37:24
【问题描述】:
所以我有这个简单的 jQuery ajax 函数,但它在 each 函数中,因为它在网站上的每个帖子中
$('.post .button').each(function() {
$(this).click(function() {
$.ajax({
url: 'action/update.php',
type: 'POST',
data: {
postID: $(this).closest('.container').find('.postID').val()
},
success: function() {
$(this).css({'color' : 'green'});
}
});
});
});
但成功后我想更改已单击该元素的一些 css。 基本上我想发布这个而不需要使用基本的 html 帖子刷新网站。 甚至可能吗?你能帮帮我吗?
【问题讨论】: