Hi,
The better solution is to use something like Modernizr (http://www.modernizr.com/) to do your feature detection on the client-side.Modernizr is an open source, MIT-licensed JavaScript library that detects support for many HTML5 & CSS3 features.
If your browser does not support the canvas API, the Modernizr.canvas property will be false.
<script >
if (Modernizr.canvas) {
// let's draw some shapes!
} else {
// no native canvas support available :(
}</script >
Ref:
http://diveintohtml5.info/detect.html[
^]
Another solution if you are using JQuery:
Checking for support for the canvas element of HTML 5
var test_canvas = document.createElement("canvas")
var canvascheck=(test_canvas.getContext)? true : false
alert(canvascheck)
Ref:
http://www.javascriptkit.com/javatutors/createelementcheck.shtml[
^]