[thelist] Detecting unix browsers

Paul Backhouse paul.backhouse at 2cs.com
Fri Dec 21 04:57:20 CST 2001


Doh, got the first one wrong with the style sheet - should be:

This is what i normally use for browsers and operating systems

<%
If Instr(Request.ServerVariables("HTTP_USER_AGENT"),"Windows") Then
%>
<link rel=stylesheet href=StyleWin.css type=text/css>
<%
Else
%>
<!-- This should cover Unix aswell -->
<link rel=stylesheet href=StyleMac.css type=text/css>
<%
End If
%>

Or if you're not using ASP then:
<SCRIPT LANGUAGE="JavaScript"><!--
if (navigator.appName == 'Microsoft Internet Explorer'){
document.write('<link rel=stylesheet href=StyleIe.css type=text/css>');
}else{
document.write('<link rel=stylesheet href=StyleNs.css type=text/css>');
}
//-->
</SCRIPT>



I'm feeling pretty rusty on browser detection. We have a client who has a
high proportion of users with Solaris and other Unix systems. They are
reporting that on Netscape 4.7 on Unix (not Linux interestingly) the font
sizes are much too small. They have suggested we detect Unix browsers and
serve a new stylesheet for them.

The only problem is that they don't have a recommendation for the detection
code. Anyone out there doing this on their site or who can point the way for
what we should be trying to detect?







More information about the thelist mailing list