Excluding Unknown Browsers
If you provide only evidence for specific browsers in the detection logic, your site will not be usable if a visitor uses a different browser. Consider the following example:
Code:
// WRONG Application - not to use!
if (document.all)
{
// Internet Explorer
document.write('<link rel="stylesheet" type="text/css" src="style-ie.css">');
}
else if (document.layers)
{
document.write('<link rel="stylesheet" type="text/css" src="style-nn.css">');
}
Note like the precedence example of style only for Internet Explorer and Navigator 4 and also then only if the visitor has activated the support Javascript in own browser. The customers of Netscape 6, Netscape 7, CompuServe 7, Mozilla, Work will not be in a position to visualizing the site correctly.
Unidentifying Browsers
Authors of a general failure of the network will be formed to assume that when a browser is not Netscape Navigator 4, Internet Explorer, it should be and vice versa. For example:
Code:
// WRONG Application - not to use!
if (document.all)
{
// Internet Explorer
elm = document.all['menu'];
}
else
{
// Assume Navigator 4
elm = document.layers['menu'];
}
Mark on how the above example assumed that each use browser which Internet Explorer is not navigator 4 and tried layers.
Bookmarks