springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-19 14:21:35
70
我想发生的是,当我在键入“是”后点击按钮时,它会说“老头:很高兴听到你的声音,你叫什么名字?”但相反,它调用了一个不同的函数,对尚未添加的问题表示else答案。这可能是我太笨了,因为我是新手,对HTML/JSS很不擅长,但如果有人知道为什么会发生这种情况,并让我知道它会大大增加
html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="style.css" rel="stylesheet"type="text/css"/>
<script src="script.js"></script>
</head>
<body onload="onload()">
<center>
<h1 class="Title"> Text Adventure HMTL </h1>
<h5> Please write your answer directly how it was written after the question</h5>
<br><br>
</center>
<p id="currentQuestion">
<p id="givenAnswers"></p>
<input type="textbox" id="answer" placeholder="Type your answer here">
<input id="enter" type="button" onclick="wakeUp()" value="enter">
</body>
</html>
js:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="style.css" rel="stylesheet"type="text/css"/>
<script src="script.js"></script>
</head>
<body onload="onload()">
<center>
<h1 class="Title"> Text Adventure HMTL </h1>
<h5> Please write your answer directly how it was written after the question</h5>
<br><br>
</center>
<p id="currentQuestion">
<p id="givenAnswers"></p>
<input type="textbox" id="answer" placeholder="Type your answer here">
<input id="enter" type="button" onclick="wakeUp()" value="enter">
</body>
</html>
您可以在这里测试它并查看它的功能:https://idkwthisgoingon.kitten3604.repl.co/
顺晟科技:
编辑的答案
您正在使用如果不正确:不像您认为的那样工作。 Do:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>repl.it</title>
<link href="style.css" rel="stylesheet"type="text/css"/>
<script src="script.js"></script>
</head>
<body onload="onload()">
<center>
<h1 class="Title"> Text Adventure HMTL </h1>
<h5> Please write your answer directly how it was written after the question</h5>
<br><br>
</center>
<p id="currentQuestion">
<p id="givenAnswers"></p>
<input type="textbox" id="answer" placeholder="Type your answer here">
<input id="enter" type="button" onclick="wakeUp()" value="enter">
</body>
</html>
在您的支票中。
总是返回true,因为非空字符串在转换为布尔值时总是被认为是true,因此if语句中的第二个条件是true
编辑
虽然我已经回答了这个问题,但我想给您一个建议:
尽可能地泛化代码。它将使您的代码更短、更易读,并且在为代码添加功能和复杂性时也会有所帮助。
下面是我尝试遵循以下建议的对话框机制的实现:
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11