Hello, I'm not able to use addClass when I give a response to my page using ajax. What happens is that it adds the class to my html element for a moment, but the behavior is as if the page was loading, so nothing happens. I'm doing a paging.
$('.waves-effect a').click(function(e) {
e.preventDefault();
var url = $(this).data('href');
$.ajax({
type: "GET",
url: url,
success: function(response) {
$('#form').html(response)
},
complete: function() {
$(".waves-effect").click(function() {
$(this).addClass("active");
});
}
});
});
<li class="waves-effect"><a data-href="webmail.php?page=<?=$i?>"><?=$i?></a></li>
I'm a bit of a layman in JQuery, thanks for everyone's help.