window.onload not implemented error

When I use the window.onload=OnLoadEvent() method I got an script error saying not implemented.

To fix the issue I used same function without "()" as follows.
window.onload=OnLoadEvent;