I am new to JQuery and get thefollowing error messages:
ERROR: '$' is not defined. [no-undef]
ERROR: 'location' is not defined. [no-undef]
For completeness, I have added all the code from the two relevant pages down here.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fruits Game</title>
<meta charset="utf-8">
<meta name="viewport" content = "width = device-width, initial-scale =1, user-scalable = yes">
<link rel="stylesheet" href="styling.css">
</head>
<body>
<div>Irrelevant content here</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="jquery.js"></script>
</body>
</html>
jquery.js
var playing = false;
$(function(){
//click on start reset button
$("#startreset").click(function(){
//We are playing
if(playing == true){
location.reload();
}else{
//We are not playing
playing = true;
}
})
});
I have tried many solutions from: JQuery - $ is not defined, yet none seem to solve my problem. Who can tell me what I am doing wrong?