Javascript not working? #21474
-
Javascript not working! I tried the following:
Who can help me? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
Hi. 👋 There are several ways to include JavaScript in an HTML file, the most used are internal or external, both internal and external are usually placed either in the
Hope that helps your journey into the land of code. 👍 |
Beta Was this translation helpful? Give feedback.
-
My answer: This won’t work. |
Beta Was this translation helpful? Give feedback.
-
The language guess on your repository page says precisely nothing about whether the script will work. 🙂 To elaborate a bit more: Github uses Linguist to guess the language of your files. Those guesses are strictly per file, an HTML file that includes a few scripts will show up as HTML. If you keep your scripts in separate files and include those from your HTML file, the separate script files should show up as Javascript. github/linguistLanguage Savant. If your repository's language is being reported incorrectly, send us a pull request! - github/linguist |
Beta Was this translation helpful? Give feedback.
-
airtower-luna:
Could you explain it clearer? |
Beta Was this translation helpful? Give feedback.
-
What you have in your .html files aren’t 100% valid HTML structure, it’s missing the What I posted above is a valid HTML structure, the content that you display on your page should be inside the The Hope that explains it. 🙂 |
Beta Was this translation helpful? Give feedback.
-
No, not really.
That code is the one I used. |
Beta Was this translation helpful? Give feedback.
-
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
Which means there’s a syntax error in your file on line 11, in this case, that’s this line
A syntax error will error out your compiler meaning whatever’s in there won’t run, change the line to |
Beta Was this translation helpful? Give feedback.
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.Which means there’s a syntax error in your file on line 11, in this case, that’s this line
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. 🙂