Your Ad Here

Posted By

krisdb on 06/29/07


Tagged

javascript


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

luman
Runtheball


getBrowser


 / Published in: JavaScript
 

  1. function getBrowser() {
  2.  
  3. var sBrowser = navigator.userAgent;
  4.  
  5. if (sBrowser.toLowerCase().indexOf('msie 5.0') > 0)
  6. return 'ie5';
  7. if (sBrowser.toLowerCase().indexOf('msie 6.0') > 0)
  8. return 'ie6';
  9. if (sBrowser.toLowerCase().indexOf('firefox/2') > 0)
  10. return 'ff2';
  11. else
  12. return;
  13. }

Report this snippet  

You need to login to post a comment.