0
Always?
When coding in the SoloLearn App, do I always have to use window.onload = function() {main code} for it to work properly or is that a more general syntax rule for javascript
1 Answer
+ 1
It's just an event. You can use it on Sololearn or outside Sololearn.
The reason you must use it on Sololearn is that scripts are linked in head not in end of body.
In general when we code on our machine, we link it at the end of body so you don't need to use that event.