Browser sniffing – Detecting what browser is being used with Dojo

Even though Dojo does a great job in making cross browser and platform JavaScript development very easy there are times when you may want to do something that is specific for a browser.  Instead of re-inventing the wheel you can use the many functions in the Dojo library to help with this. There is an entire article on “browser sniffing” on the Dojo toolkit web site and it comes with a few good examples to learn from:

  • dojo.isIE
  • dojo.isMozilla
  • dojo.isFF
  • dojo.isOpera
  • dojo.isSafari
  • dojo.isKhtml
  • dojo.isAIR – true if running within the Adobe AIR enviroment
  • dojo.isQuirks – is the browser in Quirks-Mode
  • dojo.isBrowser (not typically needed when only targeting browsers)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s