![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
11/02/2002, 08:59
|
![Avatar de Kaopectate](http://static.forosdelweb.com/customavatars/avatar14704_1.gif) | Colaborador | | Fecha de Ingreso: diciembre-2001 Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 23 años, 1 mes Puntos: 38 | |
Re: Como se la version del browser Yo lo hago asi:
<html>
<head>
<script LANGUAGE="JavaScript">
function getBrowserType(){
var myUserAgent;
var myMajor;
myUserAgent = navigator.userAgent.toLowerCase();
myMajor = parseInt(navigator.appVersion);
if ((myUserAgent.indexOf('mozilla') != -1) &&
(myUserAgent.indexOf('spoofer') == -1) &&
(myUserAgent.indexOf('compatible') == -1) &&
(myUserAgent.indexOf('opera') == -1) &&
(myUserAgent.indexOf('webtv') == -1)){
if (myMajor > 4) return "nav6";
if (myMajor > 3) return "nav4";
return "nav";
}
if (myUserAgent.indexOf("msie") != -1){
if (myMajor > 4) return "ie5";
if (myMajor > 3) return "ie4";
return "ie";
}
return "other";
}
</script>
<title></title>
</head>
<body>
<script language="JavaScript">
document.writeln("<p>Browser: " + getBrowserType() + "</p>");
</script>
</body>
</html> |