Variable uses an Automation type not supported in JavaScript


Language Message
简体中文 变量使用了一个 JavaScript 中不支持的 Automation 类型
简体中文 变量使用了一个 JScript 中不支持的 Automation 类型
英文 Variable uses an Automation type not supported in JavaScript
英文 Variable uses an Automation type not supported in JScript
繁体中文 此變數使用了 JScript 不支援的 Automation 型態

已知 eval() 方法及 ActiveXObject() 在 IE9 中可能会抛出这个异常。

案例

eval("_TMP_FOR_EVAL_ = function (event){ showContinueContextMenu(event)}")

上面这个在 IE8 中工作正常,但是在 IE9 中抛出异常。 可以使用下面的替代方案:

this.ownerDocument.defaultView.eval("_TMP_FOR_EVAL_ = function (event){ showContinueContextMenu(event)}")

相关异常

参考