[jQuery] browser sniff?
[jQuery] browser sniff?
I'm trying to shorten my browser sniffer (that just happens to be
required to adjust for miscalculations in opera and safari, and to
lock out IE5.5 and below) to ...well, as short as possible. Has
anyone tried anything jqueric (jqueryish?) to handle this?
var ua=navigator.userAgent.toLowerCase();
var sf=(ua.indexOf('safari')!=-1);var ge=(ua.indexOf('gecko')!=-1);
i=ua.indexOf('msie');var ie6up=(i!=-1&&(parseInt(ua.charAt(i+5)))>=6)?
true:false;
i=ua.indexOf('opera');var o7up=(i!=-1&&(parseInt(ua.charAt(i+6))>=7))?
true:false;
_ robb irrgang
_
_ robb@subdue.com
_ 224-805-9450
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/