If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The difference is when the showMeTheDoc function is invoked, and what is assigned to window.onload.

In your first snippet, you're assigning a reference to a function. When the onload event fires, that function reference is executed, which then executes showMeTheDoc.

In your second snippet, the showMeTheDoc function is being executed immediately rather than waiting for the onload event, and the return value of that invocation is what is then assigned to window.onload.