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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -