title: jQuery to add Browser-Name into css-class
body: <p>I'm using jQuery to detect the Users Browser-Agent and than add the browser-name as a css-class to the body. This works like magic with webkit and mozilla … but with msie it fails — but don't know why. For msie i also have to add not only the «msie», but also one class with the version-number of the used msie (like «msie7» or «msie8»).</p>
  
  <p>Everything works, only the msie-section does not!</p>
  
  <p>my (full) jQuery-Code:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  &lt;!--
  (function($){
      $(function(){
  
          var $copy = $('div.SPA_printcontact').clone();
          var $body = $('body');
  
          $copy.insertAfter('#printdate');
  
          if($.browser.msie) {
              $body.addClass('msie')
              var userAgent = userAgent.substring(0,userAgent.indexOf('.'));
              var version = userAgent;
              $body.addClass('msie' + version)
          }
          if($.browser.webkit) {
              $body.addClass('webkit')
          }
          if($.browser.mozilla) {
              $body.addClass('mozilla')
          }
  
      });
  }(jQuery));
  --&gt;
  &lt;/script&gt;
  </code></pre>