Answer the question
In order to leave comments, you need to log in
Proper "launch" of custom js files?
For example, I created my js file in the assets/javascripts directory.
In order for my js code to work adequately with turbolinks, I make an event handler $(document).on('page:load', myfunc).
Everything is fine.
But the larger the project becomes, the more "own" js files appear.
Also what, in everyone I should register this event handler?
In general, is it possible to somehow simplify the structure of the client code so as not to write $(document).ready, and $(document).on('page:load'...) all the time.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question