Is there a difference in the App and Web HTML editor? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Is there a difference in the App and Web HTML editor?

I wrote a small website in the HTML editor. I used the Website for Sololearn and not the app. However, when I went to bed I wanted to keep writing in the code so I switched to the app. The problem is; The web solution works but the app version does not. Is there a difference in the way the web and app editor process the code? 🤔 Here's the code: https://code.sololearn.com/WifSLe4btEin/?ref=app

19th Nov 2023, 10:27 PM
Mike Mortensen
Mike Mortensen - avatar
2 Respuestas
+ 3
This will help you: enclose your initialization routine in a block that is only executed when the page completed loading. Currently it is not guaranteed that the HTML structure already exists when the JS is executed. This is why you are getting the error in console. onload = () => { const game = new Game ("arena"); }
20th Nov 2023, 8:03 AM
Tibor Santa
Tibor Santa - avatar
+ 1
Tibor Santa thanks! That did the trick! Had to move the scope as well, however that I can refactor later.
20th Nov 2023, 8:10 AM
Mike Mortensen
Mike Mortensen - avatar