<
html
>
< head >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第一次调用 " );
}
</ script >
</ head >
< body >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第二次调用 " );
}
</ script >
</ body >
</ html >
< head >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第一次调用 " );
}
</ script >
</ head >
< body >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第二次调用 " );
}
</ script >
</ body >
</ html >
那么,怎么解决这个办法呢!
请看下面。
<
html
>
< head >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第一次调用 " );
}
</ script >
</ head >
< body >
< script type ="text/javascript" language ="javascript" >
function twofunction ()
{
alert( " 第二次调用 " );
}
window.attachEvent('onload',twofunction);
</ script >
</ body >
</ html >
< head >
< script type ="text/javascript" language ="javascript" >
window.onload = function ()
{
alert( " 第一次调用 " );
}
</ script >
</ head >
< body >
< script type ="text/javascript" language ="javascript" >
function twofunction ()
{
alert( " 第二次调用 " );
}
window.attachEvent('onload',twofunction);
</ script >
</ body >
</ html >