1

There is a hardcoded custom module made which uses an ajax written in prototype. I cannot want to touch that!. I just want to do some simple jquery stuff after that ajax is executed. So i tried:

jQuery( document ).ajaxComplete(function( event, xhr, settings ) {
  if ( settings.url === "my-url" ) {
    alert(12);
  }
});

Another version that I tried is:

jQuery(document).bind("ajaxComplete", function(){
  alert(12);
});

Neither of them is not working. No error in the console. Nothing!. I loaded first the jquery version and after that my code. What else should I try ? Thx

Attila Naghi
  • 2,535
  • 6
  • 37
  • 59

1 Answers1

0

That event is triggered only when the ajax request is sent through jQuery.

Whenever an Ajax request completes, jQuery triggers the ajaxComplete event. Any and all handlers that have been registered with the .ajaxComplete() method are executed at this time.

You should check if any event is triggered after your ajax prototype request

You can find a different way to do that here

Community
  • 1
  • 1
peppeocchi
  • 814
  • 1
  • 9
  • 22