Posted By

quantal on 07/03/13


Tagged

control internet explorer Versiyon


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

quantal


internet Explorer Versiyon Control


 / Published in: JavaScript
 

// adding ie version class on html tag

  1. //IE VERSION CONTROL
  2.  
  3. function getInternetExplorerVersion() {
  4. var rv = -1; // Return value assumes failure.
  5. if (navigator.appName == 'Microsoft Internet Explorer') {
  6. var ua = navigator.userAgent;
  7. var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  8. if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
  9. }
  10. return rv;
  11. }
  12.  
  13. function checkVersion() {
  14. var msg = "Internet Explorer";
  15. var ver = getInternetExplorerVersion();
  16.  
  17. if (ver > -1) {
  18. $("html").addClass("ie").addClass("ie" + ver); //add version Class
  19. /*
  20. if ( ver >= 10.0 )
  21. msg = "NEW browser."
  22. else
  23. msg = "Old browser.";*/
  24. }
  25. }
  26. checkVersion();

Report this snippet  

You need to login to post a comment.