【问题标题】:How to display text from a dataset in code.org?如何在 code.org 中显示数据集中的文本?
【发布时间】:2021-08-06 23:35:08
【问题描述】:

我正在开发一款龙与地下城应用程序,该应用程序最终将显示来自 D&D 书籍的信息。所以我试图从数据集中显示拼写信息。我尝试过使用 readRecords 和 updateScreen,它在屏幕上显示为“未定义”

我非常感谢任何有用的提示。 https://studio.code.org/projects/applab/VKNZ6xoJsy1ahETdh4R23_-Fs-JI3aF714hsoJqi3qg

【问题讨论】:

  • 请将您的代码添加为代码块,而不是外部链接

标签: code.org app-lab


【解决方案1】:

您需要将第 87 行的 updateScreen(spellOptions, spellTime); 移动到第 84 行的 readRecords() 块中。您还需要将 spellTime 设置为 records[0].time

下面是第 84 到 87 行的代码:

readRecords("Spells", {name: spellOptions}, function(records) {
  spellTime = records[0].spellTime;
  updateScreen(spellOptions, spellTime);
});

【讨论】:

    猜你喜欢
    • 2022-06-22
    • 1970-01-01
    • 2022-12-15
    • 1970-01-01
    • 1970-01-01
    • 2014-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多