【发布时间】:2018-03-13 06:31:46
【问题描述】:
Sharepoint 中的 WebChat 得到回发。在 sharepoint 中添加 web 部件并尝试实现 webchat。
每当我点击输入或发送按钮时,它都会回发。当事件发生(例如:按钮点击)时,我们如何避免回发?
<script type="text/javascript"
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<script src="https://unpkg.com/botframework-webchat/botchat.js"></script>
<script type="text/javascript">
var jq = $.noConflict();
jq(document).ready(function () {
try {
BotChat.App({
directLine: {
secret: 'Qc--iFxcebI.cwA.poU.XfmiUiUHwK9AjLZXzUoA_ewI3s6fktbN447HI9qVqLE'
},
user: {
id: _spPageContextInfo.userLoginName //_spPageContextInfo.userLoginName
},
bot: {
id: 'botid'
},
sendTyping: true,
resize: 'detect'
}, document.getElementById("bot"));
} catch (e) {
console.log(e.message);
}
try {
jq('.wc-header > span').html('Search Bot');
jq(".wc-header").click(function () {
jq(".botcontainer").toggleClass("height");
});
} catch (e) {
debugger;
console.log(e.message);
}
});
</script>
<div class="botcontainer ms-dialogHidden ms-fullWidth noindex" id="bot" ></div>
【问题讨论】:
-
嗨,谢谢您的回复……但我的按钮没有按钮……它来自 botchat.js 和 botchat.css