Hello I was to create a sketch in p5js in the atom editor. As part of it I tried to upload an image and I got this error:
Refused to execute script from 'http://127.0.0.1:3000/Draw-Pixel/MyGame.png' because its MIME type ('image/png') is not executable.
i tried this with JPEG, JPG, PNG and XCEF, and I always got the same error (of course the file extension and name changed). I don’t have p5 DOM installed I don’t know if that means anything, It didn’t come when I downloaded p5js complete.
Please help soon.
This line in index.html makes the browser download that image and try parsing it as JavaScript. That will fail miserably, and that’s why the error shows up.
Yeah I was watching this tutorial on how to add an image to p5js and I think they said (or I misunderstood that they said) to put in that line in HTML, I don’t even remember where I saw it.
Maybe it was a coding train video?