JavaScript Tutorial/Navigator/appName

Материал из Web эксперт
Перейти к: навигация, поиск

Check the browser type by using the navigator.appName

<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
if (navigator.appName == "Microsoft Internet Explorer")
{
 alert("Your browser is Microsoft Internet Explorer.");
}
else if (navigator.appName == "Netscape")
{
 alert("Your browser is Netscape Navigator.");
}
else
{
 alert("You are not using Netscape Navigator or Internet Explorer.");
}
//-->
</script>
<title>Find Browser Name</title>
</head>
<body>
</body>
</html>


navigator.appName

<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT language="JavaScript">
<!--
window.alert(navigator.appName);
//-->
</SCRIPT>
</BODY>
</HTML>