Это моя кнопка
<button id="resend-invitation-button-<?php echo $user['id'] ?>"
class="btn btn-warning cp_width_100pct resend-invitation-button height_36px"rel="<?php echo $user['email'] ?>"><?php echo $this->translate->_("invite_again") ?></button
Это информационное сообщение
<div id="user-invited-message-<?php echo $user['id']?>" class="alert alert-success org-user-messages" role="alert" style="display: none"><?php echo $this->translate->_("message_user_invited") ?></div>
Это мой вызов ajax Когда я нажимаю кнопку «Пригласить снова», должно отображаться информационное сообщение «Приглашено успешно» **
$('.resend-invitation-button').click(function() {
var email = $(this).attr('rel');
var data = {
email: email
};
console.log(data);
$.ajax("/organization/users/resendinvite",{
type: "POST",
data: data
})
.done(function(response) {
console.log(response);
if(response == 200) {
$('.org-user-messages').hide();
$('#user-invited-message-' + email).show();
$('#orgstatus-span-' + userId).text("INVITED SUCCESSFULLY");
}
if(response == 404){
$('.org-user-messages').hide();
}
if(response == 500){
$('.org-user-messages').hide();
$('#user-error-message-' + email).show();
}
})
.fail(function(response) {
console.log('FAILURE');
});
});