Ask coding questions

← Back to all posts
"Unexpected token else " error
bgrubert (174)

I have been working on this clicker game in html css and JS, but I am getting an unexpected token else error even though there seems to be nothing wrong.

Ps. Please note that I am only 11 so this is not going to be a professional code.

Thanks!

Commentshotnewtop
rediar (400)

amazing! I never really learned js, because of python flask, but now you're making me want to.

avibeskrowni (140)

You are doing an else if to a function. You may want to change the else if to an if but I'm not sure what you're going for.

avibeskrowni (140)

or maybe indent that else if to make it line up with the if?

avibeskrowni (140)

P.S. Insanely amazing for an 11-year old.

bgrubert (174)

@avibeskrowni You are younger than me!

3465728974563 (50)

@bgrubert hey I was wondering if you wanted to do a colab on this repl.it. I have already started making my own version of this repl.it and was wondering if you would be interested in joining me and helping me out with adding stuff to this and making it a real game that people can play whenever they want. The progress I've made so far can be found here: (https://repl.it/@3465728974563/Chess-Clicker-1) . If you happen to be interested in this colab than just respond to this in some sort of way.

JustinPhillip (19)

just some advice: you might wanna sort out yout files, like put all your images into an "images" folder, etc.

3465728974563 (50)

@JustinPhillip If you try to put the images in the folder then he'll have to redo a whole bunch of code whenever it comes to the images because he'll have to add images/ or whatever he decides to name the folder and it's annoying and unnecessary