DEV Community

Discussion on: DOM basics(The why and the what)

Collapse
 
johlun99 profile image
johlun99 • Edited

Well first of all, welcome to the wonderful world of webdev! Secondly, there actually was a few small things i noticed I thought I might share.

  1. I noticed under the javascript -> internal section where you mention that you put your "java" code between script tags. What I think you mean here is javascript right? Java and javascript are two vastly different languages and if you're interested in reading more on that subject as well I'll post a link below, but basically javascript tried to get on the hype of java when they launched so they named it quite similarly. :)

geeksforgeeks.org/difference-betwe...

  1. Javascript -> positioning: Well, there are no rules that you have to put your javascript in the end and can be put elsewhere in your code. The thing there that's important is to make sure they're in the right order, for an example if you use JQuery, then Jquery should be included first in order for the code to be "visible" for your own code who uses it later. Although it's preffered to have the javascript at the end of the body tag, this is mostly because of performance reasons. Since when a page is renderd and let's say the browser sees a script tag, it will run it on the spot creating a bit of lag before it can continue loading in the page. Therefore if you load the javascript last it will make the page seem to load faster.

hackinbits.com/interview-questions...

Hope I could help out a bit, and just like the original post if you find any inaccuracies/possibilities for improvement. Let me know! :)

But in the meantime, hope I could help and happy coding!