Pages

Friday, November 19, 2010

How to find the Browser Version and Operating System using Java Script?

How to find the Browser Version and Operating System using Java Script?

The Following code will do this.


<html>
<head><Title>Browser Name</Title>
<script type="text/javascript">
 
//Browser Name

function Data(){
 document.writeln("<B>Java Script Rocks");
 var i=navigator.appName;
 alert(i);
 }

//Operating System Type

function VersionData(){
var i=navigator.appVersion;
 alert(i);
 }
</script>

</Head>
<body>
<input type="submit" value="Get Name" onclick="Data()"/>
<P>Version Check using Java Script</P>
<input type="submit" value="Get Version" onclick="VersionData()"/>
</body>
</html>

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete