Results 1 to 3 of 3
Jul 29, 2013, 14:03 #1
- Join Date
- Sep 2005
- Sydney, NSW, Australia
- 24 Post(s)
- 1 Thread(s)
Script Placement and Types of Script
The only two types of scripts I know of that still need to go in the head are:
1. framebreaker scripts and similar where the script is deciding whether to continue loading the page or to start a new page load
The one type of script I know of that still needs to wait for the load event to trigger before it can run is where the script is going to substitute different images for any externally linked images that fail to load.
Question One: Can anyone think of any other types of script that need to go in the head rather than just before the </body> or which need to wait for the load event to trigger before they run?
I know that any script can go in the head with an appropriate delay applied - but which onces must go there? I also know that all scripts placed at the bottom can apply a delay but which ones will actually fail to work at all if you don't apply a delay?
I know that there are lots of other types of scripts that might still use document.write but you can always find an alternative to those that doesn't use that call or alternatively rewrite the script to get rid of that call - something that you cannot do with ad scripts so that using postscribe to dynamically change how document.write works is the only alternative to actually jumbling the scripts through the page.