Respuesta :

Kizr
Due to the wording I would use the document.onload method.

Example: document.onload = function(){
                   document.write('Hello World');
                }