+ 1

I don't understand the problem

Why isn't the watchTV function not working? https://sololearn.com/compiler-playground/WWEZD9jSsAWZ/?ref=app

17th Jan 2025, 12:28 PM
Pro Gamer 12 Nobody
Pro Gamer 12 Nobody - avatar
4 Respuestas
+ 2
I didn’t look so carefully at the code(too long) but it seems you are missing an else statement on line 394
17th Jan 2025, 2:00 PM
Zvi
Zvi - avatar
0
Pro Gamer 12 Nobody Seeing typos all over. For starters, HTML attributes usually follow name="value" pattern. Your onclick attributes on lines 12, 14, 16, 22, 23 need to wrap their values in quotes. Your onclick on line 24 is missing the parenthesis. Should be "watchTV()". You are not consistent with your function naming scheme. This can lead to errors since Javascript is case-sensitive. I see onclick function calls for these functions: secretR(), btnRouleteYou(), Escape(), reset(), watchTV, gamble(), BuyG(), and TV(). For your achievements section, you might also look at using case statements where possible to reduce your huge list if statements. Or at least look to see if you can consolidate some of them together using if - else if - else blocks.
19th Jan 2025, 6:10 AM
Shardis Wolfe
19th Jan 2025, 10:11 PM
Pro Gamer 12 Nobody
Pro Gamer 12 Nobody - avatar
0
Pro Gamer 12 Nobody You are still missing quotes around your onclick values on lines 15, 17, 19, 25, and 26. For example, line 15 should be onclick="secretR()" Internal CSS should be at the top inside <head>. However, your CSS and especially your JS is extensive enough they should be moved to the CSS and JS tabs. Code Playground handles linking the external CSS and JS for you, but in actual website you would link your CSS in <head> with <link rel="stylesheet" href="styles.css"> And you would link JS at the end of your <body> with <script src="script.js"></script>
20th Jan 2025, 6:16 AM
Shardis Wolfe