javascript - 未捕获的 ReferenceError:f1e90d585f7b48a78107 未在 HTMLHeadingElement.onclick (questions.html:1) 中定义
问题描述
这里提出的大多数问题都包含一个 js 库,但我的没有。我真的不知道为什么它说它没有定义。这是我的代码。我试图触发一个事件,onclick
但我不断收到上述错误。这是我使用 onclick 的地方。哦,我的 id 是 UUID
fetch('http://127.0.0.1:5000/api/v1/questions')
.then((response) => response.json())
.then((data) => {
let outputs = '<h2> Top Questions </h2>';
data.message.forEach(function(questions) {
outputs += `
<div>
<h3 onclick="getSingleQuestion((${questions.Question_ID}))"> <a href="#">Title: ${questions.title}</a><h3>
<p> Description: ${questions.description}</p>
<p> Tags: ${questions.tags}</p>
<hr>
</div>
`;
});
document.getElementById('outputs').innerHTML = outputs;
})
解决方案
推荐阅读
- view - 实体框架使用视图而不是表创建模型
- flutter - 创建带阴影的弧形卡片
- java - 使用 json 配置使用自定义转换器将 POJO 转换为 POJO
- c# - 如何调整图表大小超过屏幕分辨率?
- git - git pull 仅适用于上游主机 - 是否需要推送?
- python - 如何在多处理中运行 pandas concat?
- google-cloud-platform - 有很多 Compute Engine API 请求是否正常?
- ios - TabbarViewController iOS中的Swift Center Circle按钮
- python - 如何克服将 sqlite 文件加载到 colab 中的错误?
- android - 将单选按钮数据发送到 Kotlin 中的下一个活动