the image onload event handler.aspx

来自「这个是用javascript编写的TheImageonloadEventHand」· ASPX 代码 · 共 41 行

ASPX
41
字号
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="The Image onload Event Handler.aspx.cs" Inherits="The_Image_onload_Event_Handler" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
     <title>The Image onload Event Handler</title>
 <script type="text/javascript">
  <!--
  function loadIt(theImage,form) {
   if (document.images) {
    form.result.value = "";
    document.images[0].lowsrc = "章节代码/第18章/DESK.GIF";
    document.images[0].src = theImage;
   }
  }
  function checkLoad(form) {
   if (document.images) {
    form.result.value = document.images[0].complete;
   }
  }
  function signal() {
   if(confirm("You have stopped the image from loading. Do you want to try again?")) {
    location.reload();
   }
  }
  //-->
 </script>
</head>
<body>
    <img alt="image" src="章节代码/第18章/CPU2.GIF"  width="120" height="90" 
   onload="if (document.forms[0].result) document.forms[0].result.value='done'" /> 
    <form id="form1" runat="server">
    <input type="button" value="Load keyboard" onclick="loadIt('章节代码/第18章/CPU2.GIF',this.form)" /> 
  <input type="button" value="Load arch" onclick="loadIt('章节代码/第18章/ARCH.GIF',this.form)" />
 <p><input type="button" value="Is it loaded yet?" onclick="checkLoad(this.form)" /> 
    <input type="text" name="result" /> <input type="hidden" /></p>
    </form>
</body>
</html>

⌨️ 快捷键说明

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