
marjuanm
Zeta
Programador
Verificación en dos pasos activada
Que tal, les comparto un script para detectar bajo que navegador nos encontramos desde JavaScript, saludos:
<script language="JavaScript">
alert("Es Internet Explorer=" + isInternetExplorer().toString());
alert("Es Opera=" + isOpera().toString());
alert("Es Safari=" + isSafari().toString());
alert("Es Chrome=" + isChrome().toString());
alert("Es firefox o similar=" + isFirefoxSimilar().toString());
function isInternetExplorer()
{
if(navigator.userAgent.toLowerCase().indexOf("msie") >= 0 || navigator.userAgent.toLowerCase().indexOf("trident") >= 0)
return true;
else
return false;
}
function isOpera()
{
if(navigator.userAgent.toLowerCase().indexOf("opera") >= 0 || navigator.userAgent.toLowerCase().indexOf("presto") >= 0)
return true;
else
return false;
}
function isSafari()
{
if(navigator.userAgent.toLowerCase().indexOf("safari") >= 0 && navigator.userAgent.toLowerCase().indexOf("chrome") < 0)
return true;
else
return false;
}
function isChrome()
{
if(navigator.userAgent.toLowerCase().indexOf("safari") >= 0 && navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
return true;
else
return false;
}
function isFirefoxSimilar()
{
if(navigator.userAgent.toLowerCase().indexOf("firefox") >= 0)
return true;
else
return false;
}
</script>
<script language="JavaScript">
alert("Es Internet Explorer=" + isInternetExplorer().toString());
alert("Es Opera=" + isOpera().toString());
alert("Es Safari=" + isSafari().toString());
alert("Es Chrome=" + isChrome().toString());
alert("Es firefox o similar=" + isFirefoxSimilar().toString());
function isInternetExplorer()
{
if(navigator.userAgent.toLowerCase().indexOf("msie") >= 0 || navigator.userAgent.toLowerCase().indexOf("trident") >= 0)
return true;
else
return false;
}
function isOpera()
{
if(navigator.userAgent.toLowerCase().indexOf("opera") >= 0 || navigator.userAgent.toLowerCase().indexOf("presto") >= 0)
return true;
else
return false;
}
function isSafari()
{
if(navigator.userAgent.toLowerCase().indexOf("safari") >= 0 && navigator.userAgent.toLowerCase().indexOf("chrome") < 0)
return true;
else
return false;
}
function isChrome()
{
if(navigator.userAgent.toLowerCase().indexOf("safari") >= 0 && navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
return true;
else
return false;
}
function isFirefoxSimilar()
{
if(navigator.userAgent.toLowerCase().indexOf("firefox") >= 0)
return true;
else
return false;
}
</script>