Originally Posted by minder
If you did
window.onload = preparePage; //this is a valid js statement
then the function preparePage would have to be defined before the window.onload because in this case you are assigning a reference to a function and the function needs to be first defined before you can assign references to it to anything.
window.onload = doit;
function doit( )
document.body.style.backgroundColor = "lightblue";
Think again, Minder.