zhouwei_doris
zhouwei_doris
采纳率0%
2017-03-27 06:50 阅读 1.6k

请问canvas跨域问题如何解决

40

var ctx = canvas.getContext('2d');
var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
如果canvas中的图片源的url(http://10.4.60.44:7002/......)与当前应用的url(http://10.4.60.44:7003/......)不相同,
浏览器控制台出现: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.,请问该如何解决呢?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐