On the Why OpenOffice.org page, in addition to the conditional I.E.6 CSS

<!--[if IE 6]> <link href="/branding/css/ie6.css" rel="stylesheet" 
type="text/css" media="screen" /> <![endif]-->

there is another JS browser detection script

<script type="text/javascript" src="ie6.js"></script>

This script is supposed to insert another(?) css page for i.e. 6 compatibility

 var browser=navigator.appName;
 var b_version=navigator.appVersion;
 var version=parseFloat(b_version);
 if ((browser=="Microsoft Internet Explorer") && (version=6))
 {
   document.write('  <link rel="stylesheet" href="ie6.css" type="text/css" />');
   alert("Your browser cannot display this site correctly - please ask your 
vendor for an upgrade");
}
However, it i doesn't work.

parseFloat(navigator.appVersion) will return 4 since the first number in the 
string will be 4, not 6

Also, (version=6) in the if statement will always represent true since this is 
an assignment and not a comparison.

The end result is that the version variable does not indicate the version and 
even if it did, the version isn't being checked anyway.

browser=="Microsoft Internet Explorer" still means that only i.e. users will 
have the code run, but i.e. 7 users will as well. These users will get an alert

alert("Your browser cannot display this site correctly - please ask your vendor 
for an upgrade");
telling them to upgrade even if they are on the latest version, and they will 
also get the CSS inserted even if they don't need it.

Even if we should be advising i.e. 7 users to "upgrade" to a better browser, 
this script should probably be fixed (maybe removed? I think the conditional 
statement is probably enough).

Something like:

if (navigator.appName=="Microsoft Internet Explorer") {
    var versionStart = navigator.appVersion.indexOf("MSIE ");
    if (versionStart != -1) {
        var version=parseFloat(navigator.appVersion.substr(versionStart+5,3);
        if (version==6) {
           document.write('  <link rel="stylesheet" href="ie6.css" 
type="text/css" />');
           alert("Your browser cannot display this site correctly - please ask 
your vendor for an upgrade");
        }
    }
}


********************
NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is 
intended only for the use of the addressees and is confidential. 
If you are not an intended recipient or responsible for delivering 
the message to an intended recipient, any review, disclosure, 
conversion to hard copy, dissemination, reproduction or other use 
of any part of this communication is strictly prohibited, as is the 
taking or omitting of any action in reliance upon this communication. 
If you receive this communication in error or without authorization 
please notify us immediately by return e-mail or otherwise and 
permanently delete the entire communication from any computer, 
disk drive, or other storage medium.

If the above disclaimer is not properly readable, it can be found at 
www.td.com/legal
                                                           
AVERTISSEMENT DE CONFIDENTIALITE                   
Ce courriel, ainsi que tout renseignement ci-inclus, destiné uniquement 
aux destinataires susmentionnés,  est confidentiel.  Si vous 
n’êtes pas le destinataire prévu ou un agent responsable de la 
livraison de ce courriel, tout examen, divulgation, copie, impression, 
reproduction, distribution, ou autre utilisation d’une partie de ce 
courriel est strictement interdit de même que toute intervention ou 
abstraction à cet égard.  Si vous avez reçu ce message par erreur ou 
sans autorisation, veuillez en aviser immédiatement l’expéditeur par 
retour de courriel ou par un autre moyen et supprimer immédiatement 
cette communication entière de tout système électronique.

Si l'avis de non-responsabilité ci-dessus n'est pas lisible, vous 
pouvez le consulter à www.td.com/francais/legale

Reply via email to