So, as you can see, in the code example above, I’ve loaded the javascrript below the ending of the </body> tag. This way, only after the content has loaded, will the .js file load, not causing any problems.
Side note: There is also one other way of going about this. That is using a CDN. Though this is costly, it will be really helpful. A CDN, takes all the heavy objects in a web page, like images, js files, css files and uploads them to their server, supplying it when you need it. As CDN’s have servers located at a lot more locations than your server, they will help your site load faster at more physical distance from your servers.
What do you think of the techniques ? Tell me in the comments below.