Pour la détection MSIE vous pouvez utiliser JavaScript:
// This function returns Internet Explorer's major version number,
// or 0 for others. It works by finding the "MSIE " string and
// extracting the version number following the space, up to the decimal
// point, ignoring the minor version number
<SCRIPT LANGUAGE="JavaSCRIPT">
function msieversion()
{
var ua = window.navigator.userAgent
var msie = ua.indexOf ("MSIE ")
if (msie > 0) // If Internet Explorer, return version number
return parseInt (ua.substring (msie+5, ua.indexOf (".", msie)))
else // If another browser, return 0
return 0
}
</SCRIPT>
Voici un exemple de la façon de l'appeler partout dans votre code html:
<SCRIPT LANGUAGE="javascript">
if (msieversion() >= 0)
document.write ("This is Internet Explorer");
else
document.write ("This is another browser");
</SCRIPT>
http://support.microsoft.com/kb/167820 http://support.microsoft.com/kb/167820
J'aime la simplicité de cette réponse. Est-ce que quelqu'un a des objections à ce sujet, parce que si les autres réponses sont plus complètes (numéro de version de couverture, etc.) tout ce dont j'ai besoin est le type de navigateur. Mais tous les problèmes connus ici. Au fait, je l'ai essayé sur FF et ça a dit Netscape! – Duber
Je l'ai essayé sur Chrome et il dit aussi netscape: s –
Chrome, Firefox et Safari retournent le nom "Netscape". –