用 html2canvas 想把 canvas 转成图片,使用以下方法:
canvas.toDataURL("image/png")
在开发者工具里正常,但是真机报错:
stack: "Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
最终添加参数解决:
allowTaint:true,
useCORS: true,
用 html2canvas 想把 canvas 转成图片,使用以下方法:
canvas.toDataURL("image/png")
在开发者工具里正常,但是真机报错:
stack: "Error: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
最终添加参数解决:
allowTaint:true,
useCORS: true,