Open
Description
Hi folks,
I want to track "Ajax" requests in application.js as globally in my Ruby on Rails project but even though I used all the possibilities offered by jQuery and ujs ( ajax:complete
, ajax:success
, ajax:error
, ajaxComplete()
and ajaxSuccess
), I could not run it.
I observed that this problem usually occurs after js.erb
response/requests.
application.js:
$(function() {
$('document').on('ajax:complete', function() {
alert('ajax:complete event triggered');
});
$('document').on('ajax:success', function() {
alert('ajax:success event triggered');
});
});
Ruby 2.7.8
Rails 6.0.3
jQuery: 3.5.1
Rails/ujs: 7.0.4
PS: I solved this problem using "Vanilla JS" by handling the "XMLHttpRequest" property.
Metadata
Metadata
Assignees
Labels
No labels