Why is this code not working? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
23rd Oct 2018, 11:40 PM
EYOEL ASFAW
EYOEL ASFAW - avatar
3 Antworten
+ 4
The same issue as 70% of JS code not working threads in here. This is because your script loads before DOM. To fix this, wrap your entire JS within: window.onload = function() { // Your JS here } This fixes the problem with null on getContext().
23rd Oct 2018, 11:46 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
EYOEL ASFAW the source of your image is supposed to be an URL instead of an absolute path to a file in your computer. You can upload your image to an image hosting site and copy the link to your code. https://www.sololearn.com/discuss/389765/?ref=app
24th Oct 2018, 1:23 AM
Hoàng Nguyễn Văn
Hoàng Nguyễn Văn - avatar
+ 1
but it doesn't work
24th Oct 2018, 12:23 AM
EYOEL ASFAW
EYOEL ASFAW - avatar