Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use Canvas in IE7 or IE8?

Is there any workaround to use "Canvas" tag in IE7 and IE8 ? Pls let me know.

<input type="text" id="textSign" value="Sign" />
<input type="button" onclick="javascript:return changeSign();" value="changeSign" />
<canvas id="e" width="150" height="100"></canvas>
<script type="text/javascript">
var textSign = document.getElementById("textSign").value;
      function changeSign() {
             textSign = document.getElementById("textSign").value;
                    var canvas = document.getElementById("e");
                    var context = canvas.getContext("2d");
                    context.fillStyle = "#4c4c4c";
                    context.font = "30px Giddyup Std";
                    context.fillText (textSign , 20, 50);
                }
            </script>
like image 450
richa_pandey Avatar asked May 07 '12 13:05

richa_pandey


2 Answers

Yes, there is a project to simulate the canvas API on older versions of IE (7 and 8).

You can find it here, simply include the JavaScript file and go on as canvas was supported.

Please note that is another layer of JavaScript code on the top of IE (and it's not famous to be very fast to parse JavaScript...)

like image 198
Adriano Repetti Avatar answered Sep 28 '22 04:09

Adriano Repetti


Yes there is : https://developers.google.com/chrome/chrome-frame/

But as with any modern web technology, you'll have to make extensive tests while developping. And depending on your deployement location, you may be forbidden to use that (sysadmins still imposing IE7 may have strange requirements).

like image 40
Denys Séguret Avatar answered Sep 28 '22 04:09

Denys Séguret