views:

32

answers:

1

Hello,

I am working on a website, and I would like to refresh a portion of the page after an ActiveX component has been installed. I have a general idea of how to do this with polling, which I am working on getting going :

function detectComponentThenSleep(){

   try{
       // Call what I want ActiveX for, if the method is available, or 
       // ActiveXComponent.object == null --- test for existance
       document.getElementById("ActiveXComponent").someMethod(); 
   }
   catch{
       // Try again, if the method is not available
       setTimeout(detectComponentThenSleep, 100);
   } 
 }

However, what I would REALLY like to do is something like this:

 ActiveXObject.addListener("onInstall", myfunction); 

I don't actually have the source for the ActiveX component, but I have complete control of the page I am hosting it on. I would like to use JavaScript, if possible, to accomplish this.

So, my question is 1.) will this actually work with the polling method? and 2.) Is there an interrupt/listener like way of doing this? I am sure I am missing something with connecting the dots here, I can already detect if the component is present, but I am having trouble doing this asynchronously.

Thank you very much for your time and help,

-Brian J. Stinar-

A: 

1.) This didn't work at all with the polling method. 2.) I couldn't find an interrupt / listener way of doing this.

I finally ended up just putting this entire ActiveX compnenent on it's own page. ActiveX does a page refresh on install, so I simply had the default page behavior as the what I wanted to happen when the component wasn't available. This is different than what I was trying to do, but it worked OK for my purposes.

My recommendation to anyone in a similar situation is to just put the ActiveX component on it's own page, and pass data back and forth from this page. Otherwise, you are probably going to have a lot of the problems that I had.

-Brian J. Stinar-

Brian Stinar
@Brian: you might be able to use an iframe'd page, which would handle the whole thing and get an "asynchronous-ish" feel to it...
jvenema
Thank you very much for this suggestion. This is a very logical conclusion to come to after my separate-page solution, and I wish I had implemented your idea at the time. If my customer wants a redesign on this, I will definitely try out this idea at the time. Thank you very much. I really like your suggestion. -Brian J. Stinar-
Brian Stinar