代码如下:
<script type="text/javascript">
function tt1(){
alert('tt1') ;
}
function tt2(){
alert('tt2') ;
}
function tt3(){
alert('tt3') ;
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
addLoadEvent(tt1()) ;
addLoadEvent(tt2()) ;
addLoadEvent(tt3()) ;
</script>
window.onload
示例
函数