首页 > 代码库 > jsp window.onload ,

jsp window.onload ,

1.

<html>
<body onl oad="func()">
</body>
</html>

2.

<script type="text/javascript">
function func(){……}
window.onload=func;
</script>

3.

<html>
<body onl oad="func1();func2();func3();">
</body>
</html>

4.

<script type="text/javascript">
function func1(){……}
function func2(){……}
function func3(){……}
window.onload=function(){
func1();
func2();
func3();
}
</script>

5.

<script type="text/javascript">
function func1(){……}
function func2(){……}
function func3(){……}
function addLoadEvent(func){
var oldonload=window.onload;
if(typeof window.onload!="function"){
window.onload=func;
}
else{
window.onload=function(){
oldonload();
func();
}
}
}
addLoadEvent(func1);
addLoadEvent(func2);
addLoadEvent(func3);
</script>

 

jsp window.onload ,