简体   繁体   English

我想交互式检测何时安装了ActiveX组件,并异步刷新页面的一部分

[英]I would like to interactively detect when an ActiveX component has been installed, and asynchronously refresh a portion of the page

I am working on a website, and I would like to refresh a portion of the page after an ActiveX component has been installed. 我在一个网站上工作,并且在安装ActiveX组件后希望刷新页面的一部分。 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. 我实际上没有ActiveX组件的来源,但是我可以完全控制托管它的页面。 I would like to use JavaScript, if possible, to accomplish this. 如果可能,我想使用JavaScript来完成此任务。

So, my question is 1.) will this actually work with the polling method? 因此,我的问题是1.)这实际上可以与轮询方法一起使用吗? and 2.) Is there an interrupt/listener like way of doing this? 和2.)是否有像这样的中断/监听器? 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- -布莱恩·斯蒂纳(Brian J.

1.) This didn't work at all with the polling method. 1.)这对于轮询方法根本不起作用。 2.) I couldn't find an interrupt / listener way of doing this. 2.)我找不到执行此操作的中断/侦听器的方法。

I finally ended up just putting this entire ActiveX compnenent on it's own page. 我最后最终只是将整个ActiveX组件放在自己的页面上。 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. ActiveX会在安装时刷新页面,因此我只是拥有默认的页面行为,即当组件不可用时想要发生的事情。 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. 我向处于类似情况的任何人的建议是,只需将ActiveX组件放在其自己的页面上,然后从该页面来回传递数据。 Otherwise, you are probably going to have a lot of the problems that I had. 否则,您可能会遇到很多我遇到的问题。

-Brian J. Stinar- -布莱恩·斯蒂纳(Brian J.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式确定是否已安装ActiveX控件,以及是否已禁用ActiveX控件或整个ActiveX? - How do I programmatically determine if an ActiveX control has been installed, and whether it or ActiveX as a whole has been disabled? 如何只刷新部分JavaScript代码而不刷新整个页面? - How would I refresh just a portion of JavaScript code and not the entire page? 我如何检测键盘上是否按下了 V 键? - How would I detect that the V key has been pressed on the keyboard? 我想在输入完成后触发一个函数 - I would like to fire a function after the input has been complete 如何检测移动浏览器何时返回到已暂停的页面? - How can I detect when a mobile browser returns to a page that has been paused? 检测是否已在Java中使用JavaScript安装了应用 - Detect if an app has been installed on iOS in JavaScript Javascript:检测页面何时“返回”到 - Javascript: detect when page has been navigated “back” to PDF.JS - 检测何时呈现页面 - PDF.JS - Detect when page has been rendered 我可以检测网页是否已被Google翻译过? - Can i detect if a web page has been translated by Google? 使用移动网页 - PHP 和 JS 检测设备上是否安装了 Android 应用 - Detect if Android app has been installed on the device using a mobile web page - PHP and JS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM