[removed] vs <body onload=“”/>

后端 未结 13 1778
盖世英雄少女心
盖世英雄少女心 2020-11-22 13:45

What exactly is the difference between the window.onload event and the onload event of the body tag? when do I use which and how shoul

13条回答
  •  名媛妹妹
    2020-11-22 14:45

    Sorry for reincarnation of this thread again after another 3 years of sleeping, but perhaps I have finally found the indisputable benefit of window.onload=fn1; over . It concerns the JS modules or ES modules: when your onload handler resides in "classical" JS file (i.e. referred without

提交回复
热议问题