R
R
Robert2015-09-04 21:27:19
JavaScript
Robert, 2015-09-04 21:27:19

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

1 answer(s)
C
CapeRatel, 2015-09-04
@Jowan

I do not see a problem to constantly write a handler.
In general, according to Feng Shui, turbolinks should be cut out of the project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question