Javascript navigator appName property returns the name of the client web browser. appName property of Javascript navigator object enables you to run the part of javascript based on the name of the web browser returned by it. You can skip the Javascript code that consists of objects not supported by the client’s browser according to the name of the browser returned by the appName property of navigator object.
Syntax for Javascript Navigator appName
navigator.appName
or
window.navigator.appName
You can use window.navigator also to access the appName property. Both above code syntax for javascript navigator appName objects return the same information about the web browser of the client’s system.
Example of JavaScript Navigator appName
<script language="javascript" type="text/javascript">
document.write(navigator.appName);
</script>
Above example of appName property of navigator object returns the following output for different web browsers:
In Internet Explorer navigator.appName returns:
Microsoft Internet Explorer
In FireFox navigator.appName returns:
Netscape
In Opera web browser navigator.appName returns:
Opera
Continue to next tutorial: Javascript Navigator appVersion to learn how to get web browser version.