首页 > 解决方案 > 带有 IE11 的 Azure 聊天机器人

问题描述

我知道我需要使用 webchat-es5.js,但在实现“styleOptions”时出现错误。

const styleOptions = {
    XXXXXX
};


window.WebChat.renderWebChat({
    directLine: window.WebChat.createDirectLine({
        secret: XXXX
    }),
    styleOptions
},
document.getElementById('webchat'));

我需要把这个放在哪里?它不是异步函数,我知道异步函数在 IE11 中不起作用。

这是一个样本,我是机器人新手。

标签: azure

解决方案


您只需要将整个“styleOptions”放入“renderWebChat”:

window.WebChat.renderWebChat({
    directLine: window.WebChat.createDirectLine({
        secret: XXXX
    }),
    styleOptions: {
        XXXXXX
    }
},
document.getElementById('webchat'));

推荐阅读