Discuss Scratch

turkey3
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

I am turning my project http://scratch.mit.edu/projects/23424265/ into a browser-game! So far it can be viewed here http://www.codecademy.com/turkey3/codebits/MmJtfK although I do not have the gameplay yet, only the HTML and CSS.

Anyways, I could use a tad of help. First scroll to the bottom of the HTML document and check out the button. It has the “onClick” event which should trigger the function in my JavaScript called resetAll() to run, but it does not. I cannot figure out why the event is not working. Does anyone have any suggestions on how to fix this?

StarscreamClone
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

Just glancing through, the first thing I noticed was that the function resetAll() was in comment syntax ( */ ) at the end of your script.js file. Did you mean to do that?

Last edited by StarscreamClone (July 23, 2014 19:23:54)


Somewhere in my 20s | He/It
Workin' on my degree in computer science and cognitive science, and the future president of 2036!

Surge is my imaginary husband - he's the guy in my icon!
turkey3
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

StarscreamClone wrote:

Just glancing through, the first thing I noticed was that the function resetAll() was in comment syntax ( */ ) at the end of your script.js file. Did you mean to do that?
That isn't the function commented out, that is just some currently useless jquery code that makes a call to the function. The function should be above the comment.

StarscreamClone
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

turkey3 wrote:

StarscreamClone wrote:

Just glancing through, the first thing I noticed was that the function resetAll() was in comment syntax ( */ ) at the end of your script.js file. Did you mean to do that?
That isn't the function commented out, that is just some currently useless jquery code that makes a call to the function. The function should be above the comment.
Alright, just making sure…

Somewhere in my 20s | He/It
Workin' on my degree in computer science and cognitive science, and the future president of 2036!

Surge is my imaginary husband - he's the guy in my icon!
scratchisthebest
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

Okay, I have no idea what is going on.

This works (somehow)
<button onclick="resetAll(); return false;">Test</button>

edit: Nevermind, it doesn't??

Last edited by scratchisthebest (July 23, 2014 21:24:25)


I am a Lava Expert
turkey3
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

scratchisthebest wrote:

Okay, I have no idea what is going on.

This works (somehow)
<button onclick="resetAll(); return false;">Test</button>
Cool! Mind explaining why that fixes it?

scratchisthebest
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

Nevermind I fixed it for real (that was a red herring, I changed too many things at once, my fault)

You didn't close your comment at the end, it somehow managed to break everything. Close it with a */ and it works.

Last edited by scratchisthebest (July 23, 2014 21:25:30)


I am a Lava Expert
turkey3
Scratcher
1000+ posts

World's Hardest Puzzle HTML Edition- (Also could use a tad of help)

scratchisthebest wrote:

Nevermind I fixed it for real (that was a red herring, I changed too many things at once, my fault)

You didn't close your comment at the end, it somehow managed to break everything. Close it with a */ and it works.
Oh wow!

Powered by DjangoBB