html - How can I trigger javascript function once I load the webpage (Not using form and submit button) -
for example, want html page can able call javascript function automatically once loaded or refreshed. don't want trigger function using form , submit button.
how can so? , coding? many thanks.
[edited] okay working right now. many guys , have 1 more question. using servlet print out html tag make html page. using servlet since want load data mysql database , pass parameter javascript carry out calucation. last question how can control time of calling javascript? want call read database first , triggering javascript function (at same time passing data read parameter) .how can that? answer!
javascript call function after page load
<body onload="myfunc() ;">
or
<script> window.onload=myfunc ; </script>
refer http://www.mkyong.com/javascript/javascript-call-funtion-after-page-load/
Comments
Post a Comment