1. Home
  2. Computing & Technology
  3. JavaScript
Stephen Chapman
Stephen's JavaScript Blog

By Stephen Chapman, About.com Guide to JavaScript

Feature Sensing

Friday November 6, 2009
Test if the browser supports a specific JavaScript Feature directly, do not test whether the browser was one that did or didn't support that feature ten years ago.

Right from day one JavaScript has provided a simple way to check whether the version of JavaScript currently being run supports a given object, method or function. The same (or similar code) can also be used to check if a property or variable exists. Using this way of testing if the browser supports your script your script will always work in new browsers that add that support even where the prior version didn't.

Feature Sensing
Comments

No comments yet. Leave a Comment

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore JavaScript
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.