window.onload=function(){console.log('load2')}document.body.onload=function(){console.log('load1')}document.body.addEventListener('load',function(){console.log('load3')})以上代码,load3总是出不来
2 回答
饮歌长啸
TA贡献1951条经验 获得超3个赞
target.addEventListener(type,listener,useCapture);Firefox浏览器支持addEventListener(),IE是attachEvent();document.body.addEventListener('onload',function(){console.log('load3');},false);document.body.attachEvent('load',function(){console.log('load3');})
添加回答
举报
0/150
提交
取消