To be or not to be: window.onload
<p>Silly question but when I write <code>window.onload = alert('hi')</code> I get the alert.</p>

<p>However if I test for its existence: <code>if (window.onload) alert("exists")</code> I get <code>undefined</code>. How come?</p>
