Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
93
rated 0 times [  95] [ 2]  / answers: 1 / hits: 25062  / 12 Years ago, thu, march 22, 2012, 12:00:00

I'm using html2canvas plugin to generate snapshot of web pages.
The problem is that everything runs ok in the localhost, however when deployed on the remote server I get the following error : Unable to get image data from canvas because the canvas has been tainted by cross-origin data.



I've found a plugin that is supposed to work : https://github.com/niklasvh/html2canvas-proxy



The problem is that I don't know how to use it !



Similar question is asked here but remains without answer : https://github.com/niklasvh/html2canvas/issues/61


More From » jquery

 Answers
147

I've solved this issue, the proxy code needs to be added to the server side scripts.
Then I needed to change the order of if statements to make calling the proxy the first choice since it will be the case for all the images we are dealing with in our project.
Thanks Niklas.
More details are here : https://github.com/niklasvh/html2canvas-proxy/issues/2#


[#86663] Wednesday, March 21, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
raymondd

Total Points: 620
Total Questions: 112
Total Answers: 94

Location: Namibia
Member since Mon, Feb 21, 2022
2 Years ago
raymondd questions
Thu, Apr 22, 21, 00:00, 3 Years ago
Thu, Jul 9, 20, 00:00, 4 Years ago
Thu, Apr 9, 20, 00:00, 4 Years ago
Thu, Jul 25, 19, 00:00, 5 Years ago
;