0

Alert box!

when I finished the model quiz I have seen that the script near the close end of the body tag reduces the loading time of the page....explain me that!!

5th Aug 2017, 10:24 AM
Darwin
Darwin - avatar
5 Réponses
+ 5
It does not really reduce the loading time of the page, but the time of wait before displaying the page: > 1st, the source file (html) is loaded > 2nd, the html code is parsed, from start to end, loading external ressources, executing scripts, and building display in order of their appearance in source code So, putting JS << script near the close end of the body tag >> will delay its execution to after all visual elements are displayed, sparing time of parsing/executing JS code ;)
5th Aug 2017, 10:39 AM
visph
visph - avatar
+ 4
Yes, you can link/embed JS <script> inside both <head> as <body>...
5th Aug 2017, 10:43 AM
visph
visph - avatar
+ 2
thank u bro .....thanks for u r help.
5th Aug 2017, 10:44 AM
Darwin
Darwin - avatar
+ 1
can we link JavaScript file in a body tag...
5th Aug 2017, 10:41 AM
Darwin
Darwin - avatar
+ 1
I have linked it in a head tag
5th Aug 2017, 10:41 AM
Darwin
Darwin - avatar