When writing PHP templates for WordPress pages we should not make use of the <body> tag since it already is available in header.php that is contacted web site.
How than are we able to make use of the onLoad event inside the template?

Since I am writing several template I can not utilize it in header.php.

Don't attach it through the HTML attribute.

Attach it with an non obtrusive event handler. Because WordPress uses jQuery, that's as simple as...

$(window).load(function() {
    // ....