Call function in body onload event
<html> <head> <title>Random Quote</title> <script type="text/javascript"> function getQuote() { document.write("onload"); } </script> </head> <body onload="getQuote();"> </body> </html>