Forum Moderators: open
I've got about 5 javascripts that load on my main page, but I have identified one that seems to be slowing up the overall loading time of the page. What I would like to do is to be able to specify one or a couple of javascripts to delay their loading so that it speeds up the loading time of the page. Bear in mind that I have no experience writing or altering javascripts!
If someone could give me an exact example of how I could go about doing this, that would be much appreciated!
Thank you for your time.
<script src="blah.js" type="text/javascript" defer="defer">
This suggests that the client may wait till the rest of the doc is downloaded before downloading the script. It may be simpler to put your offendingly heavy scripts at th bottom of the page.
seems to be slowing up the overall loading time of the page.
What may be happening is that the script is initialising the elements within the page. There may belittle that can be done about this. We'll need to know what the script does(and why it's so large).
I have 3 Google ads, a phpbb topics anywhere js, and an Absolute News Manager js that displays a set number of headlines. It is this last one that seems to cause the problem. I tried using the defer attribute before posting to this forum, however it loaded up the js in the whole window after loading up my main page, so I don't know what that's all about.