我只是在学习javascript而且我遇到了一些麻烦.我正在选择你自己的冒险游戏,你会经历一个迷宫.有图片显示正在发生的事情.您做出每个决定后,图片都会发生变化.在向左或向右键入后更改图片时出现问题.我一直收到Uncaught TypeError:每次尝试加载图片时都无法设置属性'src'的空错误消息.Java表示问题出现在第66行
这是我的代码:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Brian.Bosco-Hazey Maze Adventure</title>
<script type="application/javascript">
var flag;
var output;
var name;
var n1 = "what is your name?"
var s1 = "You wake up in a spooky maze. You must find your way out or this place will become your grave. You can go <b>Left</b> or <b>Right</b>?";
var s2 = "You come across a wizard at a fork in the maze. He gives you a magic sword to defend yourself with. …Run Code Online (Sandbox Code Playgroud)