Z
Z
Zhenya2019-04-02 22:00:31
JavaScript
Zhenya, 2019-04-02 22:00:31

Is it ok to split javascript like this?

For example, now I include the same app.js file for all pages on the site. Therefore, when I need to initialize some Owl slider on the "Contacts" page, I have to first if/else check if the required element is even on the page.
Bottom line: is it okay to include one common app.js file for each page on the site and another unique one for each page, for example, contacts-page.js?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-04-02
@bazarovevgeny

Yes, good

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question