Fires immediately after the browser loads the object

解决方案 »

  1.   

    网页加载完毕时执行。
    onload Event  Internet Development Index --------------------------------------------------------------------------------Fires immediately after the browser loads the object. SyntaxInline HTML <ELEMENT onload = "handler" ... >  All platforms 
    Event property object.onload = handler JScript only 
    object.onload = GetRef("handler") Visual Basic Scripting Edition (VBScript) 5.0 or later only 
    Named script <SCRIPT FOR = object EVENT = onload>  Internet Explorer only Event InformationBubbles No 
    Cancels No 
    To invoke Open a page in the browser to invoke this event for the document or any object within it.  
    Default action Loads the object for which the event is specified.  Event Object PropertiesAlthough event handlers in the DHTML Object Model do not receive parameters directly, a handler can query an event object for data.Show Available PropertiesaltKey Sets or retrieves a value that indicates the state of the ALT key.  
    altLeft Sets or retrieves a value that indicates the state of the left ALT key. 
    clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. 
    clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. 
    ctrlLeft Sets or retrieves the state of the left CTRL key.  
    offsetX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.  
    offsetY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.  
    screenX Retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.  
    screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.  
    shiftLeft Retrieves the state of the left SHIFT key.  
    type Sets or retrieves the event name from the event object.  
    x Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element. 
    y Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element. ResThe browser loads applications, embedded objects, and images as soon as it encounters the applet, embed, and img objects during parsing. Consequently, the onload event for these objects occurs before the browser parses any subsequent objects. To ensure that an event handler receives the onload event for these objects, place the script object that defines the event handler before the object and use the onload attribute in the object to set the handler. The onload attribute of the body object sets an onload event handler for the window. This technique of calling the window onload event through the body object is overridden by any other means of invoking the window onload event, provided the handlers are in the same script language. ExamplesThis example uses an onload event handler to display a message in the window's status bar when the page has finished loading.<BODY>
    <SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">
    window.status = "Page is loaded!";
    </SCRIPT>
    </BODY>
    This example sets an onload event handler for an img object. The handler uses the event object to retrieve the URL of the image.
      

  2.   

    还有一个问题:html文件中的代码是不是从上往下执行的,例如有20个同一个等的table是不是执行到第二table时第一个tabel中的内容已经在网页上可以显示出来的了呢? 另外如果每个表中都有一段javascript,是不是也是按顺序执行,执行完一段显示一段呢?
      

  3.   

    还有一个问题:html文件中的代码是不是从上往下执行的,例如有20个同一个等的table是不是执行到第二table时第一个tabel中的内容已经在网页上可以显示出来的了呢? 另外如果每个表中都有一段javascript,是不是也是按顺序执行,执行完一段显示一段呢?
          还有一个问题:html文件中的代码是不是从上往下执行的,例如有20个同一个等的table是不是执行到第二table时第一个tabel中的内容已经在网页上可以显示出来的了呢? 另外如果每个表中都有一段javascript,是不是也是按顺序执行,执行完一段显示一段呢?
          还有一个问题:html文件中的代码是不是从上往下执行的,例如有20个同一个等的table是不是执行到第二table时第一个tabel中的内容已经在网页上可以显示出来的了呢? 另外如果每个表中都有一段javascript,是不是也是按顺序执行,执行完一段显示一段呢?
          还有一个问题:html文件中的代码是不是从上往下执行的,例如有20个同一个等的table是不是执行到第二table时第一个tabel中的内容已经在网页上可以显示出来的了呢? 另外如果每个表中都有一段javascript,是不是也是按顺序执行,执行完一段显示一段呢?