【发布时间】:2020-11-03 14:39:41
【问题描述】:
嗨,我正在研究 amazon lex 和
- 想知道如何在 amazon lex 中换行以在下一行显示文本。我用过 \n 但它不起作用。查看屏幕截图。
- 我可以同时向用户显示 2 条消息吗?我是 lex 的新手,所以请指导我。谢谢。
【问题讨论】:
标签: amazon-lex
嗨,我正在研究 amazon lex 和
【问题讨论】:
标签: amazon-lex
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
//Add the botResponse in the Amazon lex.
let botResponse = "This is a first response @newLine This is second response @newLine This is third response."
let pushToChat = botResponse.split("@newLine")
$("#btn2").click(function(){
pushToChat.forEach(res =>{
$("ol").append(`<li>${res}</li>`);
})
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<ol>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ol>
<button id="btn2">Append list items</button>
</body>
</html>
【讨论】: