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»).
Everything works, only the msie-section does not!
my (full) jQuery-Code:
<script type="text/javascript">
<!--
(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));
-->
</script>