When I run following html,css,js it is running but not running in sololearn? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When I run following html,css,js it is running but not running in sololearn?

https://code.sololearn.com/Wr0BtkqyvnKE/?ref=app

8th Sep 2021, 3:29 PM
Gajjala Venkata Sai Sri Harsha Hanumantha Rao
Gajjala Venkata Sai Sri Harsha Hanumantha Rao - avatar
3 Answers
+ 3
Gajjala Venkata Sai Sri Harsha Hanumantha Rao , the whole code in the JS should be inside window. onload. Look at the code. https://code.sololearn.com/Wf7s1xiP36bj/?ref=app
8th Sep 2021, 3:37 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
TheWh¡teCat 🇧🇬 thanks for helping. May I know reason why should we write that in sololearn but even if I did not write in my code editor it runs.
8th Sep 2021, 3:51 PM
Gajjala Venkata Sai Sri Harsha Hanumantha Rao
Gajjala Venkata Sai Sri Harsha Hanumantha Rao - avatar
0
Different browsers and different app versions have different loading orders. window.onload() explicitly loads the script as the window loads
8th Sep 2021, 4:08 PM
Lisa
Lisa - avatar