Because of document.write, where you put a script tag within a file can have a huge impact on page loading time. The recommendation is to place the script source tags as close to the bottom of the body as you can. The reason for that is that when a script tag is loading, the browser has to be pessimistic about what damage that script might do to the document it hasn't parsed yet. It will stop downloading of assets, it will stop looking for images it can load, and not do anything. Basically, everything gets frozen until the HTTP request to get the script tag completes and the script runs to completion. At that time, it can then resume HTML parsing. If you have several script tags in a row, you're going to go serial stop request, response, execute, stop request, response. So it slows everything down. If you put it at the bottom then there's a chance for all of the images that are in the document to be loading concurrently, so you just get much faster performance.
Users browsing this forum: Google [Bot] and 0 guests