Scroll to the top of an element when document is loaded Intention: Automatically scroll the window to the top of a DOM element when the document is loaded.  



via JavaScript:

window.onload = function(){
    document.getElementById('foo').scrollIntoView(true);
};


Questions and Concerns:


Is there a more compact and/or smarter technique?
Does this technique pose issues or potential conflicts?
With the above said, should it matter where on the document it's loaded? If so, what's the best location? I've already studied this question and its references closely and I'm led to believe it's best to have this kind of script located toward the bottom the document.
Three concerns:


Error if there is not element called 'foo'
I have no idea what that boolean in the function is for.  Passing booleans at parameters is  very bad.  I have no idea what happens if I were to pass it false or any other value. Not scroll into view? I know that it is for topAlign but why not leave it out.
you can't use the onload event again without messing it up.