On Apr 25, 2:58 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > > Would somebody know that why if the 1st and 2nd line is swapped, then > > Firefox 2 and IE 7 will not run... > > As Justin said, if it loads fast enough (such as from cache), the > event will get fired before your doc has been fully loaded and before > the script exists. Remember that unless you use a load handler > (either window.onload or Prototype's own "dom:loaded" events), things > early in the page can happen before the page as a whole exists in the > browser.
Thanks very much. When the pic loads fast enough, and say the javascript code is at the beginning, it could fire off showMe() and then the function will use the element with id="display". There is also a chance that the element id="display" is not loaded yet... so in that case, will i need to move the element above the showMe() code? that probably is not a good idea to rearrange element according to javascript... by the way, so only <img> and <body> can have onload? can't I have a <div> and use an onload to mean when everything inside of it gets rendered, such as text and img. Thank you guys. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---