jquery - html2canvas - SecurityError: The operation is insecure -


i have used html2canvas.js in project convert element(body) canvas , convert canvas image. element contains images load cross domain. canvas create element working perfectly, when try canvas.todataurl("image/png"); gives error securityerror: operation insecure please me solve issue. canvas.todataurl("image/png"); working fine when image not load cross domain.

thanks in advance.

not html2canvas issue--just security issue.

if lucky...

you can use imageobject.crossorigin='anonymous' when downloading cross domain image. requires both server , browser allow anonymous x-domain transfers. sadly, servers , browsers don't yet allow.

alternatively

don't go cross-domain...serve image on own website.

alternatively

wrap image request in json request. here's script that: http://www.maxnov.com/getimagedata/


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -