I use the canvas element to draw a curve along with the text. It works fine in Chrome, Firefox, IE 9. But in IE 8.7 this does not work. Error display as:
SCRIPT438: object does not support property or method 'getContext'
I searched on Google and then found that Excanvas.js this problem, but I am getting the same error.
Thanks.
<head><!--[if IE]><script src="js/excanvas.js"></script><![endif]--></head>
My canvas HTML code:
<canvas id="myCanvas" width="679" height="290"></canvas>
My JS code is:
function drawTextAlongArc(context, str, centerX, centerY, radius, angle) { var len = str.length, s; context.save(); context.translate(centerX, centerY); context.rotate(-1 * angle / 2); context.rotate(-1 * (angle / len) / 2); for(var n = 0; n < len; n++) { context.rotate(angle / len); context.save(); context.translate(0, -1 * radius); s = str[n]; context.fillText(s, 0, 0); context.restore(); } context.restore(); } var canvas = document.getElementById('myCanvas'), context = canvas.getContext('2d'), centerX = canvas.width / 2, centerY = canvas.height + 40, angle = Math.PI * 0.8, radius = 250; context.font = 'bold 30pt Ubuntu'; context.textAlign = 'center'; context.fillStyle = 'orange'; context.strokeStyle = '#336699'; context.lineWidth = 10; drawTextAlongArc(context, 'Sustainable Skill Solutions', centerX, centerY, radius, angle);
source share