for (i = 0; i < json.people[NPC_id].dialogs.start.options.length; i++) {
concat += "\n "+ optionNumbers + ") " + json.people[NPC_id].dialogs.start.options[i].text;
optionNumbers++;
}
//append JSON dialog to label...
options = concat;
在这里我更新HUD:
function updateHUD() {
console.log(options);
$('#options').html(options);
}
然后更新 HTML:
<div id="bottomDisplay">
<ul>
<li><b>Options:</b> <div id="options"></div> </li>
</ul>
</div>
Console.log 给出格式化concat
字符串...
1) What is wrong with it?
2) What is a 狗?
3) Sorry, I don't have time :/
但是 html 出现在未格式化的 div id 中:
1) What is wrong with it? 2) What is a 狗? 3) Sorry, I don't have time :/
这是为什么?