L
L
lavezzi12015-10-01 18:55:01
JavaScript
lavezzi1, 2015-10-01 18:55:01

All js files are included at the end of the body, but the script is initialized at the beginning, what should I do?

All files are connected at the bottom, and the script starts at the beginning of the document. What options are there besides raising all scripts to the top in head?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mr Crabbz, 2015-10-01
@lavezzi1

Move the script itself to the end in a separate file. You can even inline, but after the rest of the scripts.

D
Dmitry Korolev, 2015-10-01
@Apathetic

The second option is to omit the script initialization at the end of the document =) And this is preferable to the
Third option - wrap it inwindow.onload = function ()

V
Vitaly Inchin ☢, 2015-10-01
@In4in

How to omit javascript loading in page footer?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question