If we write js code in Drupal.behaviours like below
(function($) { Drupal.behaviors.my_module = { attach : function(context, settings) { } }; })(jQuery);
that code will be execute multiple times on a page if needed even after an ajax callback.
But in the preprocess_node
I have added an external js file. The problem is on node page there is a view with an ajax pager. When I move to next page through views ajax pager(views infinite pager
) then that external js did not work.
So my question is, Is there a way to add the external js to Drupal.behaviours?