when window.onload is called, an applet should have been loaded, so you can start to use the applet in window.onload event handler

解决方案 »

  1.   

    <applet name="nice" …… onload="function"></applet>
    This applet is uesed for load a picture,so it's a long time for loaded.
    I have try to write onload event handler,but nothing was happened!!
      

  2.   

    try
    <body onload="somefun()">
      

  3.   

    I have try.But that function must execute after the applet was loaded.
    bdw ,applet not supprt onload event handler right?
      

  4.   

    According to MSDN:
    onload Event 
    applies to 
     APPLET, BODY, EMBED, FRAME, FRAMESET, IFRAME, IMG, LINK, SCRIPT, window http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onload.aspif you are interested, this article might be helpful:http://groups.google.com/groups?hl=en&threadm=3B2EB0AB.3C87009C%40eatel.net&rnum=4&prev=/groups%3Fq%3Dapplet%2Bonload%26hl%3Den%26rnum%3D4%26selm%3D3B2EB0AB.3C87009C%2540eatel.net
    An applet will be fully loaded (cached) at the document onload event, but, as soon as the browser gets a chance AFTER loading, the applet's constructor is called [although MOST applets forgo using the constructor] then the init() method. Depending on how involved this init method is, it could be a noticeable
    length of time before the applet's start() method can be called. An applet is NOT accessible until the init() method has finished
    executing, and therefore, not available until the start method is
    called. Applets are fully threaded, and there is usually quite a lot of activity
    still happening in the browser, even after the onload event has fired
    [possibilities range from animated gifs to other media file types, like
    midi, etc... to other applets being on the page]. You cannot depend on
    an applet being ready, in some cases, for up to a couple of seconds or
    so because applets have "medium" thread priority.A LiveConnected applet should "contact" JavaScript when it is ready to
    be accessed. There are several ways to do this, but one of the easiest
    is to simply call a "start" routine in JavaScript. One of the things
    this routine should do is set a global "appletReady" variable to true
    and all your JavaScript routines (that need applet access) should check
    this variable before trying to access the applet.