0

I'm getting an error message on my Code Repo for game development with JavaScript

After I typed in the JS from the code repo (8.2), I got the following message: errror: uncaught ReferenceError: Window is not defined, Line one

5th Feb 2022, 12:00 PM
Stacey Prahl
Stacey Prahl - avatar
7 Answers
+ 1
Here is the code: windows.onload=function(){ let btn = document.getElementById("jump"); let cpunt=0; btn.onclick=function(){ count +=1; } }
5th Feb 2022, 12:56 PM
Stacey Prahl
Stacey Prahl - avatar
+ 1
thanks
5th Feb 2022, 1:00 PM
Stacey Prahl
Stacey Prahl - avatar
0
I fixed "windows " to window, now I'm getting error" uncaught syntax error: Unexpected token '{' ??? the curly brace is supposed to be there!
7th Feb 2022, 7:38 AM
Stacey Prahl
Stacey Prahl - avatar
0
Same code as above window.omload = function(){ let btn = document.getElementById("jump"); let count += 1; btn.onclick = function(){ count += 1; } }
7th Feb 2022, 7:43 AM
Stacey Prahl
Stacey Prahl - avatar
0
sorry that should have read onload, not omload!
7th Feb 2022, 7:44 AM
Stacey Prahl
Stacey Prahl - avatar
0
I think I saw what I did. I jumped over and skipped th code line: let count=0;
8th Feb 2022, 5:37 AM
Stacey Prahl
Stacey Prahl - avatar
0
window.onload = funnction(){ let btn = document.getElementById("jump"); let count = 0; btn = onclick = function(){ count += 1; } }
8th Feb 2022, 5:40 AM
Stacey Prahl
Stacey Prahl - avatar