Skip to content

Javascript not working? #21474

Answered by thinkverse
BosenChang asked this question in General
Discussion options

You must be logged in to vote

If you’re using Chrome or Firefox you should have access to a developer console, which can be accessed in many ways, but usually, you can right-click a page and choose the inspect option, or the equivalent in your language, if you get that open and click the console, your see the following error.

Uncaught SyntaxError: Unexpected token '==' password_protected.html:11 

Which means there’s a syntax error in your file on line 11, in this case, that’s this line

if (password) == ("HIDDEN123") {

A syntax error will error out your compiler meaning whatever’s in there won’t run, change the line to if (password == "HIDDEN123") { and it will work. 🙂

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants