Hello, I'm having a hard time running a script after a call in ajax.
What have I done so far?
Well, I'll explain: I have a button with 2 actions, however, I need one action to occur before the other, the two are not together .
>I have already managed to do the script, but there is an error, every time there is this ajax request, the script executes the number of requests that have been made , that is, .
Where do I need help?
I need to make sure that every request made, there is no such event ('counter'), that it executes only once, regardless of how many requests have been made!
$(document).ajaxSuccess(function(event, xhr, settings) {
if (settings.url === "somefile.php") {
alert('hi');
}
});