javascript - Require.js - “模块名称...尚未加载上下文:”
问题描述
所以我对require.js很陌生,我很困惑。有人能告诉我为什么我在脚本顶部需要它时收到消息“模块名称“kahoot.js”尚未加载以获取上下文”吗?
<script>
require(['config'],function() {
require(['script']);
var Kahoot = require("kahoot.js");
var client = new Kahoot;
console.log("Joining kahoot...");
client.join(gamePin,"kahoot.js");
client.on("joined", () => {
console.log("I joined the Kahoot!");
});
client.on("quizStart", quiz => {
console.log("The quiz has started! The quiz's name is:", quiz.name);
});
client.on("questionStart", question => {
console.log("A new question has started, answering the first answer.");
question.answer(0);
});
client.on("quizEnd", () => {
console.log("The quiz has ended.");
});
});
</script>
解决方案
推荐阅读
- reactjs - webpack将控制台错误链接到模块而不是捆绑文件
- css - Youtube 嵌入:透明背景可能吗?.ytp-透明
- python - 如何使用 pandas read_xml 函数中的 xpath 参数
- oracle - 使用 ODI 代理启动时,用于调用存储过程以进行删除的 ODI 过程不起作用
- proxy - 代理异常中的地址问题
- powershell - Powershell将脚本内的参数与命令行中输入的参数结合起来?
- asp.net-core - Radzen blazor HTML 编辑器无法保存大文本 C#
- python - 下载用户个人资料时每页的 Twitter 分页限制
- google-cloud-platform - 如何使用 Terraform 在 Google Compute Image 上设置位置
- javascript - 任务相互依赖的递归 Promise 链