0

How to make HTML display before JS?

I want HTML like the header tag to load before JS how do I do that without making it all in one page?

26th Apr 2020, 10:47 PM
Danial Azadpour
Danial Azadpour - avatar
7 odpowiedzi
+ 5
Just put JS before closing body tag.
26th Apr 2020, 10:49 PM
A͢J
A͢J - avatar
+ 2
you have to put your external js import at the end of body... not: <script></script> nor: <script>/* your source code */</script> but: <script src="path/to/your/file.js"></script>
27th Apr 2020, 3:27 AM
visph
visph - avatar
+ 1
Ok, although I asked not on the same page.
26th Apr 2020, 11:06 PM
Danial Azadpour
Danial Azadpour - avatar
0
Place the <script></script> tag just before the body closing tag
26th Apr 2020, 11:27 PM
ℤ𝕚𝕔𝕔𝕠
ℤ𝕚𝕔𝕔𝕠 - avatar
0
I did I placed empty <script> tags at the bottom of the body tag and behind it, but JS still loaded before HTML, so my header was under my JS.
26th Apr 2020, 11:38 PM
Danial Azadpour
Danial Azadpour - avatar
0
If I do it the inline way, which my JS would inside my <script> at the bottom of the <body> tag inside the HTML tag, it does fix the problem, albeit I would like to know how to do it while each language would be in its tab.
26th Apr 2020, 11:41 PM
Danial Azadpour
Danial Azadpour - avatar