Re: Waiting for ActiveX object to have initialized




marcosnogood@xxxxxxxxx wrote:
I am quite new to javascript, I wonder if there is any other way
to acommplish what I need - dynamically load an active object
(not neccessarily known during load time) and block the javascript
execution until the object has executed an init function???


In IE both <object> and <script> have onreadystatechange handler you
can attach a listener, just like for XMLHttpRequest. The only
difference is that the readyState is reported in the regular IE string
notation instead of numbers:

"uninitialized" Object is not initialized with data.
"loading" Object is loading its data.
"loaded" Object has finished loading its data.
"interactive" User can interact with the object even though it is not
fully loaded.
"complete" Object is completely initialized.

This way you can:

function notifyObserver() {
if (this.readyState = 'complete') {
// object is loaded successfully
}
}

var myObject = document.createElement('OBJECT');
// prepare object
myObject.onreadystatechange = notifyObserver;
document.body.appendChild(myObject);

.



Relevant Pages

  • Re: Start up
    ... > Before Logon ... > still loading its startups. ... > predict the exact order of execution for individual startups. ...
    (microsoft.public.windowsxp.general)
  • Re: Urgent urgent help..
    ... You could look in Task Manager to see if a stub of your program is running and perhaps just not the UI. ... Maybe it is caught up in loading the UG DLL or something like that and just not displaying the window for the application? ... My question is this (i don't understand the compilation / execution ...
    (microsoft.public.vc.mfc)
  • Re: Xp...how do I get programs to start on boot.....
    ... > 13) As a Scheduled Task set to run at startup. ... > still loading its startups. ... > predict the exact order of execution for individual startups. ... > you may notice two or more system tray icons changing position with each ...
    (microsoft.public.windowsxp.general)
  • Re: table datatype in EXEC string
    ... When you EXEC dynamic SQL, the execution takes place separately from the ... > loading the table from a number of insert/select statements in the sp ... > Declare @ExecString varchar ...
    (microsoft.public.sqlserver.programming)
  • Re: Another algorithmic complexity question
    ... > loading and execution? ... Would it help me with the REPL? ... I never went to Berkeley. ... The gory details of loading and execution (as in getting an ELF or ...
    (comp.lang.lisp)