Usually we call a function during page on load with following two methods.
<body onload="happycode() ;">
<script> window.onload=happycode ; </script>
Just add an onload function at the end of the body. 🙂