S
S
someserj2017-03-18 10:02:30
JavaScript
someserj, 2017-03-18 10:02:30

How to concatenate JS and wrap it in $(document).ready()?

I want to split my code into subfiles with the implementation of different page elements in them. jQuery is needed to execute each such code.
the question is how to store all this in different files, and concatenate into one?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Pushkarev, 2017-03-18
@AXP-dev

Can be done via gulp-include

jQuery(document).ready(function($) {
    //=include include/_header.js
    //=include include/_slider.js
    //=include include/_shop.js
    //=include include/_range.js
    //=include include/_tabs.js
});

S
Stanislav Gorovoy, 2017-03-18
@Cnfc19932

https://learn.javascript.ru/modules

J
jww, 2018-01-30
@jww

I have a similar question. What is the correct way to use jQuery with gulp-conact? How did you decide?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question