[solved] Code Playground Problem | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

[solved] Code Playground Problem

why my code doesn't work when I try to run it from mobile application while it is working when I try to run it from the website ? I also tried it on my browser and it is working fine

13th Aug 2017, 9:14 PM
Ahmed
Ahmed - avatar
4 Réponses
+ 4
Full browsers are sometimes better at hiding errors. I had to delete lines 2 and 3 to get it running in Chromium (the limited version of Chrome run by CodePlayground). line 1: Replace comma with ; -- the comma chain doesn't call the two functions as expected. line 2: clearInterval - You can remove this. line 3: replace with startCountdown(); line 5: add a function definition (from line 3) and save a handle for the interval. line 13: clear it so it stops running Summary: var seconds = prompt(...); startCountdown(); function startCountdown() { var savedHandle = setInterval(function(){...}) ... clearInterval(savedHandle);
13th Aug 2017, 10:17 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
CodePlayground link?
13th Aug 2017, 9:49 PM
Kirk Schafer
Kirk Schafer - avatar
0
Yea forgot to include this :D https://code.sololearn.com/Ww6R184xJuTL/#html
13th Aug 2017, 9:53 PM
Ahmed
Ahmed - avatar
0
Thank you so much! This is a great answer
13th Aug 2017, 10:21 PM
Ahmed
Ahmed - avatar