+ 2

Javascript

Can somebody explain me why js appears first in a code... and, if possible, how can you put it after the heading? Thank you!

23rd Oct 2019, 11:14 PM
Edu Ramos
Edu Ramos - avatar
2 Réponses
+ 2
But what if I have it on a separate document?
24th Oct 2019, 11:56 AM
Edu Ramos
Edu Ramos - avatar
0
Inline JavaScript can appear either in the <head> or <body> in the HTML tab. Though it's recommended to keep it in the JavaScript tab. Your webpage loads JavaScript depending on the order it appears in your code. It's recommended to put your JavaScript code last when using inline script.
24th Oct 2019, 3:24 AM
Zone
Zone - avatar