IE creates, downloads if necessary, and intializes com object async, there
is no way for client code to safely call the com object without using a
setTimeout and checking the readyStatus (which is used to determine how
ready a com object is). if the user disables active/x or refuses the
download, then the object will never be ready.
a common method used by flash and others is to fire an event when the object
is ready. client code can catch the event.
normally you do sometime like this:
<script>
run();
function run ()
{
if (window.Component1 && window.Component1.readyState == 4))
{
Component1.SetCookie(cookieName, cookieValue, cookieDomain,
cookiePath);
Component1.SetToken(tokenSecurityHandle, tokenStateHandle,
tokenUserId);
Component1.DoSomething();
}
else
{
window.setTimeout("run()",1);
}
</script>
> I have posted the code below, please help me how can I make the window
> object understand the new object created without using alert or
[quoted text clipped - 39 lines]
> var objectTagString;
> // document.write("<OBJECT id=InstallerControl
classid=http://MachineName/Web.UI/Tem/InstallerControl.dll#InstallerControl.
> UserControl1 VIEWASTEXT></OBJECT>");
> objectTagString = document.createElement("<OBJECT id='InstallerControl'
classid='http://MachineName/Web.UI/Tem/InstallerControl.dll#InstallerControl
> .UserControl1' VIEWASTEXT></OBJECT>");
> document.body.appendChild(objectTagString);
[quoted text clipped - 8 lines]
> <SCRIPT src="scripts/JDAFrameworkReference.js"></SCRIPT>
> </BODY