When does onLoad really get triggered?
The real issue at the root of using onLoad with EditLive lies in the definition of when onLoad should trigger. According to the specification:
The onLoad event occurs when the user agent finishes loading a WINDOW or all frames within a FRAMESET.
The term that makes this problematic is “finishes loading”. Depending on the browser you use to run EditLive,onLoad may run at a variety of times including:
• Before EditLive begins its initialization
• While EditLive is initializing itself
• After EditLive is operational and ready for use
What should I use instead?
Luckily, the engineers at Ephox were well aware of the variable nature of onLoad in browsers and have created a simple alternative: onInitComplete
As an example, you could invoke EditLive using the following code:
ELApplet1_js = new EditLiveJava("ELApplet1","700","400");
For more details…
Our online documentation has complete details on the use of the onInitComplete function. We recommend you review the product documentation before implementing this feature.