Why does canvas.toDataURL() throw a security exception?

后端 未结 10 1647
天涯浪人
天涯浪人 2020-11-22 12:56

Did I not get enough sleep or what? This following code

var frame=document.getElementById(\"viewer\");
frame.width=100;
frame.height=100;

var ctx=frame.getC         


        
10条回答
  •  悲&欢浪女
    2020-11-22 13:58

    If you are simply drawing some images on a canvas, make sure you are loading the images from the same domain.

    www.example.com is different to example.com

    So make sure your images and the url you have in your address bar are the same, www or not.

提交回复
热议问题