0
How to fire an AJAX event when the user clicks on a link? Whereas, the link will redirect him to another page.
I tried to carry out the process, however, sometimes the event is not triggered(I believe it gives no time function to be triggered because of redirection).
<a id="clique" href="https://www.google.com">Clique Aqui</a>
<script>
$(document).on("click", "a#clique"", function(){
$.ajax({
/* .... */
});
});
</script>
My intention with this is to record the user click.
Alexander, I didn’t vote for your question, but I think you have a very good reputation for asking a question of this quality. Try to improve it. For example, what you mean by "record click"?
– Sam
Thanks @Sam for the thoughts. I asked the question very quickly, and I didn’t mind giving the question quality, I hope it’s clear now. It may still be a simple question, or be in duplicate, but I’m after that answer.
– Ale