javascript - Uncaught Error: SecurityError: DOM Exception 18 Canvas -


function getbase64image(img) {     var canvas = document.createelement("canvas");     canvas.width = img.width;     canvas.height = img.height;     document.body.appendchild(canvas);     var ctx = canvas.getcontext("2d");     ctx.drawimage(img, 0, 0);     var dataurl = canvas.todataurl("image/png");     return dataurl; }    

i seem violating something, can't seem find what. on how fix it?

if image drew canvas id domain canvas tainted , cannot produce data uri ftom it. copy image on same domain script prevent this.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -