页面无法响应简单的JavaScript

时间:2017-12-27 16:48:59

标签: javascript html

这是html但由于某种原因它不起作用。这些数字是有效的,因此当winnngScore = p1Score(即5)

时,它不会停止

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!DOCTYPE html> 
<html> 
<head> 
	<title>My Page</title> 
	<meta name="viewport" content="width=device-width, initial-scale=1"> 

</head> 
<body> 
<div data-role="page">

	<div data-role="content">	
		<label><input type="checkbox" name="checkbox-0" id="chbx" class="cagree"> I agree </input></label>
      <input type="button" value="Submit" id="submitbtn" class="submit" disabled/>
	</div><!-- /content -->

</div><!-- /page -->

</body>
</html>
var p1Button = document.querySelector("#p1");
var p2Button = document.getElementById("p2");
var p1Display = document.querySelector("#p1Display");
var p2Display = document.querySelector("#p2Display");
var p1Score = 0;
var p2Score = 0;
var gameOver = false;
var winningScore = 5;

p1Button.addEventListener("click", function() {
  if (!gameOver) {
    p1Score++;
    if (p1Score === winningScore) {
      gamerOver = true;
    }
    p1Display.textContent = p1Score;
  }
});

p2Button.addEventListener("click", function() {
  if (!gameOver) {
    p2Score++;
    if (p2Score === winningScore) {
      gamerOver = true;
    }
    p2Display.textContent = p2Score;
  }
})

1 个答案:

答案 0 :(得分:0)

您在if语句中将return await Promise.all(data)拼错为 $user->accType = "TBC"; //stored as "proof/img_name.jpg" in DB $user->proofLink = request()->file('proofFile')->store('proof'); $user->save(); \Mail::to('ehrs.office@gmail.com')->send(new ConfirmAccount($user));

&#13;
&#13;
gameOver
&#13;
gamerOver
&#13;
&#13;
&#13;