一、JS方法
1.最简单的调用方式,直接写到html的body标签里面:
< body onload = "myfunction()" > < html > < body onload = "func1();func2();func3();" > </ body > </ html > |
2.在JS语句调用:
|
<script type= "text/javascript" >
function myfun() { alert( "this window.onload" ); } /*用window.onload调用myfun()*/ window.onload = myfun; //不要括号 </script> |
第三种
|
<script type= "text/javascript" > window.onload= function (){ func1(); func2(); func3(); } </script> |