I have coded a site that is jquery heavy (animations, css state changes etc) that works perfectly on firefox, but has issues executing the jquery for IE. What I was wondering was is there a way of the jquery code automatically disabling when the site is viewed using IE?
            Asked
            
        
        
            Active
            
        
            Viewed 175 times
        
    0
            
            
        - 
                    possible duplicate: http://stackoverflow.com/questions/10964966/detect-ie-version-in-javascript – tobspr Jul 28 '13 at 12:42
2 Answers
1
            Sure, you can use conditional comments in the head section of your page to include jQuery only for browsers that isn't IE :
<!--[if !IE]> -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!-- <![endif]-->
 
    
    
        adeneo
        
- 312,895
- 29
- 395
- 388
0
            
            
        You might use a browser detect plugin, like that: Browser detect
For simple purposes, you could use:
function isIE () {
  var myNav = navigator.userAgent.toLowerCase();
  return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}
if (isIE()) {
    // no jquery
}
 
     
    