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!!
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 ;)
+ 4
Yes, you can link/embed JS <script> inside both <head> as <body>...
+ 2
thank u bro .....thanks for u r help.
+ 1
can we link JavaScript file in a body tag...
+ 1
I have linked it in a head tag