Help with a Code | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Help with a Code

https://code.sololearn.com/WggcUTYYPif0/?ref=app In this Code I'm trying to make a genetic algorithm. In JSANYWHERE it works just fine but in SoloLearn not ... why pls help.

4th Sep 2018, 9:40 AM
Anton Bƶhler
Anton Bƶhler - avatar
2 Respostas
+ 4
For JavaScript DOM access codes that init run from JS pane, is required to be callbacked by window.onload function due to codes of JS pane are executed in head tag before DOM elements are loaded. var c; // declare global var here window.onload = function() { // put your init code here // access var e.g. c global var }
4th Sep 2018, 9:54 AM
CalviÕ²
CalviÕ² - avatar
+ 2
thanks very much!
4th Sep 2018, 10:01 AM
Anton Bƶhler
Anton Bƶhler - avatar