简体   繁体   English

IE10:如何在没有条件注释的情况下为ActiveX分支JS?

[英]IE10: how to branch JS for ActiveX without conditional comments?

My organization has a tech form that captures browser version info about SWF, PDF, MP4, etc. 我的组织有一个技术表单,可捕获有关SWF,PDF,MP4等的浏览器版本信息。

Up to now, branching for Explorer vs everyone else was simple: a script loaded from a conditional comment runs ActiveX tests, while other browsers check navigator.plugins[] and navigator.mimeTypes[]. 到目前为止,对Explorer和其他所有人的分支都很简单:从条件注释加载的脚本运行ActiveX测试,而其他浏览器则检查navigator.plugins []和navigator.mimeTypes []。

Unfortunately, IE10 ignores conditional comments, but it doesn't support the navigator arrays either. 不幸的是,IE10会忽略条件注释,但它也不支持导航器数组。 Do I need to put all the ActiveX stuff in the main script? 我需要将所有ActiveX内容放入主脚本中吗? And if so, what is the if() statement to control it? 如果是这样,控制它的if()语句是什么?

As the commenters said, testing for window.ActiveXObject returns true on IE 10 and below. 正如评论者所说,测试window.ActiveXObject在IE 10及更低版本上返回true。 But note that Microsoft is abandoning ActiveX in their new Microsoft Edge (formerly Project Spartan) browser. 但是请注意,Microsoft正在其新的Microsoft Edge(以前称为Project Spartan)浏览器中放弃ActiveX。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM