有人可以告诉我为什么下面的代码引发ReferenceError:在第3行没有定义“ ActiveXObject”吗?
` ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("javascript");
FileInputStream fileInputStream = new FileInputStream("D:\\test.js");
if (fileInputStream != null)
{
BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));
engine.eval(reader);
Invocable invocableEngine = (Invocable)engine;
Object object = invocableEngine.invokeFunction("myExport");
}
`
test.js
function myExport(){
var myOb = new ActiveXObject(“ MyApp.Application”);
......