Why does [removed] work while [removed] doesn't?

后端 未结 2 900
别那么骄傲
别那么骄傲 2020-12-17 03:11

Can anyone tell me why the following page doesn\'t trigger an alert when it loads? If I use window.onload instead of document.onload it works. Why

2条回答
  •  别那么骄傲
    2020-12-17 03:18

    The event handler is onload not document.onload. It hangs directly off the window object (which is the default object).

提交回复
热议问题