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
2 ответов
+ 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");
}
+ 1
Tibor Santa thanks! That did the trick!
Had to move the scope as well, however that I can refactor later.