Click here to Skip to main content
15,891,682 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using this code to download image in browser which is created using HTML5 canvas.This works fine in chrome but doesn't work on IE

JavaScript
var downloadLink = document.createElement("a");
downloadLink.download = filename;
downloadLink.target = "_blank";
downloadLink.innerHTML = "Download File";
if (window.webkitURL !== null) {
// Chrome allows the link to be clicked
 downloadLink.href = canvaso.toDataURL();
}
downloadLink.click();
Posted
Comments
Kornfeld Eliyahu Peter 30-Sep-14 7:30am    
What version of IE do you talking about?
Dexter11 30-Sep-14 7:56am    
I was testing on IE9.It should be supported on IE9>=
Kornfeld Eliyahu Peter 30-Sep-14 8:27am    
It does support toDataURL()...
Can you elaborate on 'doesn't work'?

1 solution

According to this - http://msdn.microsoft.com/en-us/library/cc848897(v=vs.85).aspx[^] - IE does not support data URI on <a> element!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900