ActiveX 对象未定义

发布于 2024-09-06 21:17:41 字数 478 浏览 3 评论 0原文

Firebug 给我以下错误:

ActiveXObject is not defined
[Break on this error] var xmlhttp = new ActiveXObject("MSXML2.XmlHttp"); 

我读到 ActiveX 是一个 Microsoft 框架,主要用于 IE。我工作的地方的所有内部网页都是专门为 IE 6 设计和构建的,但现在他们要我研究如何迁移到 Firefox 和 Safari 以及其他主要浏览器......并且 ActiveX 无法在火狐。

那么,如何让 ActiveX 内容在 Firefox 和 Safari 中工作,特别是Mac(对于初学者)?我知道有几个插件?这让事情变得更容易...比如 FF ActiveX Host...但是有一个编程解决方案吗?

如果没有解决方案,没有插件,对于这个问题,是否可以用Java重写ActiveX部分?

Firebug is giving me the following error:

ActiveXObject is not defined
[Break on this error] var xmlhttp = new ActiveXObject("MSXML2.XmlHttp"); 

I've read that ActiveX is a Microsoft framework and its mostly used in IE. All of the internal web pages at the place I work were designed and built specifically for IE 6, but now they want me to research what it would take to move to Firefox and Safari and other major browsers... and ActiveX does not work in Firefox.

So how do I get the ActiveX stuff to work in Firefox and Safari specifically on Mac (for starters)? I know there is a couple of plugins? that have made things easier... like FF ActiveX Host... but is there a programmatic solution to this?

If there is no solution, no plugin, for this problem, is it possible to rewrite the ActiveX pieces in Java?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

×眷恋的温暖 2024-09-13 21:17:41

我不是网络专家,但您的网页似乎使用了 AJAX。

所以你的问题不在于在其他浏览器中使用AcitveX。

尝试这样的事情:

var xmlhttp;
if (window.XMLHttpRequest) {
  xmlhttp = new XMLHttpRequest();
} else {
  try { 
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try { 
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      xmlhttp = false; 
    }
  }
}

I’m not a web guy but it seems like your web pages use AJAX.

So your problem is not using AcitveX in other browsers.

Try something like this:

var xmlhttp;
if (window.XMLHttpRequest) {
  xmlhttp = new XMLHttpRequest();
} else {
  try { 
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try { 
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      xmlhttp = false; 
    }
  }
}
带刺的爱情 2024-09-13 21:17:41

除了 IE 之外,几乎所有相关浏览器都支持的插件 API 是 NPAPI,请参见 此介绍

我不知道有任何透明的编程解决方案来适应 ActiveX,特别是因为它是一种仅适用于 Windows 的技术。

另一种选择可能是 FireBreath 项目,它可以简化 NPAPI 的使用,并为您提供NPAPI 和 ActiveX 之上的抽象层 - 这个想法是您只需编写一次最核心的部分。
免责声明:我是该项目的所有者之一,因此可能有偏见;)

The Plugin-API nearly every relevant browser besides IE supports is the NPAPI, see e.g. this introduction.

I am not aware of any transparent programmatic soutions for adapting ActiveX, especially since its a Windows only technology.

An alternative might be the FireBreath project, which eases working with the NPAPI as well as giving you an abstraction layer over NPAPI and ActiveX - the idea being that you have to write most central parts only once.
Disclaimer: i am one of the owners of the project and thus probably biased ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文