Quantcast
Channel: web development tutorials » Html
Viewing all articles
Browse latest Browse all 12

Detecting Browser Canvas Support

$
0
0

Detecting Browser Canvas Support

Best feature of the HTML5 is Canvas,where we can develop good HTML animation ,games using canvas elements. Most of the developers will check the browser versions for detecting canvas support , i think that is bad practice . While we designing or developing HTML5 pages we should detect the feature. here is the small java script snippet.

function isCanvasSupported(){
  var elem = document.createElement('canvas');
  return !!(elem.getContext && elem.getContext('2d'));
}

Viewing all articles
Browse latest Browse all 12

Trending Articles