Moves onload event to html file