我想将Microsoft Graph API与javascript一起使用。我正在关注以下教程:
Microsoft Graph Javascript Tutorial Link
我已经按照上面的链接创建了演示应用程序。应用程序在Edge和Chrome浏览器中运行良好,但在IE 11中无法运行。 在IE 11中,我的代码出现以下错误:
IE浏览器错误屏幕截图:
IE在下面的代码行中给出错误:
const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider});
我需要修复在IE 11中不起作用的代码行:
const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider});
答案 0 :(得分:0)
该行使用es6功能来简化对象中的属性分配。不幸的是,IE不支持es6,因此您可能需要将其重写为以下内容:
const graphClient = MicrosoftGraph.Client.initWithMiddleware({authProvider: authProvider});
或使用Babel
这样的编译器