help: this code uses json and js but it does not work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

help: this code uses json and js but it does not work

the cirlce must move and change it's colour instantly, but it work only one function a time, any suggestions? https://code.sololearn.com/W1JVi2qMFfey/?ref=app

27th Feb 2019, 12:20 PM
Ahmad Ali
Ahmad Ali - avatar
1 Answer
+ 1
If you write two window.onload, the compiler will consider the last one. window.onload will override any attached event listeners. Here is the fix: https://code.sololearn.com/W9zddRf4VXEI/?ref=app
28th Feb 2019, 10:45 AM
Parsa Gholipout
Parsa Gholipout - avatar