How one can reload the custom JavaScript file after an Ajax call is completed?
In my case I have a custom JavaScript file to manipulate the views data and
filters. It works perfectly the first time a page is loaded.
But once the user sets a filter and hits Apply i.e. after the Ajax call, the JavaScript seems to stop working. It’s there but not registering any event.
I read some articles on Drupal.org but that didn’t give me a solid solution.
Note – Its not a module .js file but a custom stand alone .js file under the theme folder.
You should read up on JavaScript in Drupal, especially any part about
Drupal.bahaviors.The main point is that you need to turn your custom JavaScript file into Drupal.behaviors, because those will get reattached to content loaded dynamically via AJAX like calls.