Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么我的Mad库的Javascript输出为空?可能是HTML问题_Javascript_Html_Innerhtml - Fatal编程技术网

为什么我的Mad库的Javascript输出为空?可能是HTML问题

为什么我的Mad库的Javascript输出为空?可能是HTML问题,javascript,html,innerhtml,Javascript,Html,Innerhtml,我相信这是一个简单的解决办法,但我不认为有问题。我正在学习一个关于制作JS Mad库的教程,我想尝试一下输出。增加更多的投入。好吧,当我输入所有的输入。结果是一片空白。请记住,这是一个正在进行的项目,而不是已完成的项目。谢谢你的帮助 constuserprompts=document.querySelector(“提示”); const story=document.querySelector(“故事”); const error=document.querySelector(“错误”); c

我相信这是一个简单的解决办法,但我不认为有问题。我正在学习一个关于制作JS Mad库的教程,我想尝试一下输出。增加更多的投入。好吧,当我输入所有的输入。结果是一片空白。请记住,这是一个正在进行的项目,而不是已完成的项目。谢谢你的帮助

constuserprompts=document.querySelector(“提示”);
const story=document.querySelector(“故事”);
const error=document.querySelector(“错误”);
const submit=document.querySelector(“提交”);
submit.addEventListener(“单击”,completestory,false);
const reset=document.querySelector(“重置”);
reset.addEventListener(“单击”,resetPage,false);
document.querySelector('#name').focus();
const thename=document.querySelector(“名称”);
const firstverb=document.querySelector(“firstverb”);
const firstnoun=document.querySelector(“#firstnoun”);
常量形容词=document.querySelector(“形容词”);
const secondnoun=document.querySelector(“#secondnoun”);
常量副词=document.querySelector(“副词”);
常量storyOutput=document.querySelector(#storyOutput)
addEventListener(“keydown”,keydownHandler,false);
函数keydownHandler(事件){
console.log(“按下回车键”);
}
函数checkStory(){
}
函数completestory(){
让finishedstory=“”;
FinishedStore+=“曾经有一个人叫“+thename.value+”;
FinishedStore+=“一天,+thename.value+”是“+firstverb.value+”在
+firstnoun.value+“;
FinishedStore+=“突然,+name.value+”看到一个“+形容词.value”+
“龙!”;
FinishedStore+=name.value+“想了一会儿,做了他们唯一能想到的事情”
+“他们抓住了一个“+secondnoun.value+”;
finishedstory+=“+第二个名词.value+”在手。”+thename.value+副词.value+“攻击了龙。”;
finishedstory+=“龙变得非常困惑,离开了。结束”;
storyOutput.innerHTML=FinishedStore();
}
函数resetPage(){
}

肖恩的疯狂解放
肖恩的古怪疯狂自白
请在此处输入提示 在此处输入名称:

在此处输入动词:

在此处输入一个名词:

在此处输入一个形容词:

在此处输入另一个名词:

最后,在此处输入一个副词:

提交

您没有回答所有问题。请试一试 再次

让我们看看你写了什么

你好,Dave

重置
您收到错误
未捕获类型错误:FinishedStore不是一个函数
,因为您的
CompleteTory
函数中有这一行:

storyOutput.innerHTML=finishedStore()

按照您的定义,
finishedstory
是一个
字符串
;只需将该行更改为
storyOutput.innerHTML=finishedstory并且不再触发该错误

constuserprompts=document.querySelector(“提示”);
const story=document.querySelector(“故事”);
const error=document.querySelector(“错误”);
const submit=document.querySelector(“提交”);
submit.addEventListener(“单击”,completestory,false);
const reset=document.querySelector(“重置”);
reset.addEventListener(“单击”,resetPage,false);
document.querySelector('#name').focus();
const thename=document.querySelector(“名称”);
const firstverb=document.querySelector(“firstverb”);
const firstnoun=document.querySelector(“#firstnoun”);
常量形容词=document.querySelector(“形容词”);
const secondnoun=document.querySelector(“#secondnoun”);
常量副词=document.querySelector(“副词”);
常量storyOutput=document.querySelector(#storyOutput)
函数checkStory(){
}
函数completestory(){
让finishedstory=“”;
FinishedStore+=“曾经有一个人叫“+thename.value+”;
FinishedStore+=“一天,+thename.value+”是“+firstverb.value+”在
+firstnoun.value+“;
FinishedStore+=“突然,+name.value+”看到一个“+形容词.value”+
“龙!”;
FinishedStore+=name.value+“想了一会儿,做了他们唯一能想到的事情”
+“他们抓住了一个“+secondnoun.value+”;
finishedstory+=“+第二个名词.value+”在手。”+thename.value+副词.value+“攻击了龙。”;
finishedstory+=“龙变得非常困惑,离开了。结束”;
storyOutput.innerHTML=FinishedStore;
}
函数resetPage(){
}

肖恩的疯狂解放
肖恩的古怪疯狂自白
请在此处输入提示 在此处输入名称:

在此处输入动词:

在此处输入一个名词:

在此处输入一个形容词:

在此处输入另一个名词:

最后,在此处输入一个副词:

提交

您没有回答所有问题。请试一试 再次

让我们看看你写了什么

你好,Dave

重置
您收到错误
未捕获类型错误:已完成