html5 canvas 加载图片错误 SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement'

html5 canvas 加载图片错误 SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported


原因:跨域加载图片


解决方案:
javascript :




server 返回的http response中要加以下值到header:
Access-Control-Allow-Origin "*"







你可能感兴趣的:(Javascript)