Can someone tell me how to fix the error in my code called "Gravity"? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone tell me how to fix the error in my code called "Gravity"?

If I start my program manually (in my browser) there is no error. I decided to upload it to SoloLearn so others would be inspired by it. However it is not working here. Can someone help me? Here is the link to my code: https://code.sololearn.com/W7uELtoskXfu/?ref=app

19th Oct 2018, 7:54 PM
David Winkler
David Winkler - avatar
2 Answers
+ 5
Two things: Line 77 - the exponent operator (**) is not fully supported on all mobile devices so it would be best to replace it And the reason the code does not run besides that is that you are attempting to reference DOM elements before the are loaded. read about how to fix it below: https://www.sololearn.com/post/7444/?ref=app
19th Oct 2018, 8:15 PM
Burey
Burey - avatar
+ 1
Thank you! It solved the problem.
19th Oct 2018, 9:05 PM
David Winkler
David Winkler - avatar