faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 7 people (43%) answered Yes
Recently 3 of 7 people (43%) answered Yes

Entry

How can I use javascript to check for the IE version of a browser?

Apr 7th, 2008 23:25
ha mo, Jean-Bernard Valentaten, tola,


JavaScript has an object called navigator, which has the following 
properties that might help you:
appName -> string containing the browser name, NN will 
return 'Netscape', MSIE returns 'Microsoft Internet Explorer'
appVersion -> string containing version, subversion and some other 
information (try it out *g*)
Here's a little example what could be done with that information:
function whichBrowser()
{
  var myApp = navigator.appName;
  var myVers = navigator.appVersion.split(' ')[0];
  alert('You are using ' + myApp + ' ' + myVers);
}
HTH,
Jean
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com