Closed ghost closed 4 years ago
When you run a web page straight from your file system the browser will not consider the files to be from the same 'origin'. Loading images from sources that aren't part of the same origin will have certain limitations applied to them by the browser. This is for security reasons to stop malicious code from origins that are not under your control from attacking your page. For more information check out MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
TL;DR: If you run up a web server to serve your code you'll avoid this problem. If you haven't got a web server such as Apache installed, I recommend you install node.js and follow these instructions: https://stackoverflow.com/a/16350826
If someone can help me, I appreciate it.
I tried to replicate the 'paint an image' code but when I try to draw the new image the following error occurs:
Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. at getData (file:///C:/Users/Neto-PC/Documents/Inteligencia%20Artificial/RedeNeuralJS/RedeJS.js:40:29) at inicio (file:///C:/Users/Neto-PC/Documents/Inteligencia%20Artificial/RedeNeuralJS/RedeJS.js:47:16) at file:///C:/Users/Neto-PC/Documents/Inteligencia%20Artificial/RedeNeuralJS/RedeJS.js:92:1
My code: https://github.com/NetonD/Synaptic-JS-Rede-Neural