+ 3
Why is this code not working?
3 Answers
+ 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().
+ 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
+ 1
but it doesn't work