• 0

Canvas within iframe not working IE9


Question

Hey,

I've got a simple canvas drawing script setup, so that a user can click and draw on the canvas (for signing a signature).

The canvas is then converted into an image and uploaded to the server.

To display this file on the site, i used an iframe.

This setup works fine in the chrome and firefox.

however, in IE9 im unable to draw on the canvas when its in an iframe.

If i access the file directly in IE9, the canvas works perfectly.

To start with i thought it was a javascript error, but IE9 isn't saying there are errors, and other js still functions on the page.

Is this a bug? a problem with my code? or just a problem with IE?

Any information on this would be greatly appreciated as im going crazy trying to fix this.

Thanks in advance,

Mike

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Is the iframe hosted on the same (sub)domain as the main page? this would include making sure they're both http or https, as IE sees them as different domains and might be giving you issues because of that.

/guess

Link to comment
Share on other sites

  • 0

Is the iframe hosted on the same (sub)domain as the main page? this would include making sure they're both http or https, as IE sees them as different domains and might be giving you issues because of that.

/guess

Thanks for the quick response :D

hmm... i dont think thats the problem here.

Im using a relative link for my iframe, plus non www. does not work currently and i dont have https.

The only way to access the site is http://www.mydomain.com

Having done some more debugging, i can see that the js is being called but its just not draw on the canvas.

I used code from an example posted on the opera blog.

http://jsfiddle.net/qugTs/ - code in an iframe - doesnt work in IE9 but does in Chrome

http://dev.opera.com/articles/view/html5-canvas-painting/ - original article

Anyone else got ideas on how to solve this?

Thanks in advance

Mike

Link to comment
Share on other sites

This topic is now closed to further replies.