jaggedstone
06-17-2007, 10:17 PM
Hi everyone. I don't know if anyone will know the answer to this but I figured I'd try anyway >.<
I am trying to use a browser detection script for my new website but I'm not quite sure how to make it to include Safari in the detection. Can anyone help? Thanks in advance.
Here is what I have so far:
if(-1 != navigator.userAgent.indexOf("MSIE"))
{
// Internet Explorer
document_write('.. rel="stylesheet" type="text/css" href="ie.css">');
}
else if (-1 != navigator.userAgent.indexOf("Mozilla"))
{
// Netscape
document_write('.. rel="stylesheet" type="text/css" href="netscape.css">');
}
else
{
// other
document_write('.. rel="stylesheet" type="text/css" href="other.css">');
}
I am trying to use a browser detection script for my new website but I'm not quite sure how to make it to include Safari in the detection. Can anyone help? Thanks in advance.
Here is what I have so far:
if(-1 != navigator.userAgent.indexOf("MSIE"))
{
// Internet Explorer
document_write('.. rel="stylesheet" type="text/css" href="ie.css">');
}
else if (-1 != navigator.userAgent.indexOf("Mozilla"))
{
// Netscape
document_write('.. rel="stylesheet" type="text/css" href="netscape.css">');
}
else
{
// other
document_write('.. rel="stylesheet" type="text/css" href="other.css">');
}