load.js

来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 18 行

JS
18
字号
// specify the onload event-handler
window.onload = init;

// specify the onunload event-handler
window.onunload = term;

// a function to react to the LOAD event
function init()
{
  // set an initial textbox value
  document.getElementById("box-1").value="The Page Is Loaded";                                  
}                                          

// a function to react to the UNLOAD event
function term()
{
  alert("Thanks for visiting\nCome back soon");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?