Tuesday, February 14, 2012

Display Browser information using JavaScript


This program will display your browser information
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="javascript.aspx.cs" Inherits="javascript" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Google map using Java script</title>

<script language=javascript>
function show()
{

  document.write("Name "+navigator.appName+"<br>");
  document.write("Version "+navigator.appVersion  +"<br>");
  document.write("Codename " +navigator.appCodeName  +"<br>");
  document.write("Cookie enable"+navigator.cookieEnabled  +"<br>");
  document.write("Java Enable"+navigator.javaEnabled  +"<br>");
  document.write("Mime type"+navigator.mimeTypes  +"<br>");
  document.write("Platform"+navigator.platform  +"<br>");
  document.write("Plug ins"+navigator.plugins  +"<br>");
  document.write("System Language"+navigator.systemLanguage  +"<br>");
  document.write("User language"+navigator.userAgent  +"<br>");
  document.write("User Agent"+navigator.userAgent  +"<br>");

}


</script>

   
</head>
<body>
    <form id="form1">
    <div>
        <input id="Button1" type="button" value="Click me" onclick="show()" />
  
    </div>
    </form>
</body>
</html>

3 comments:

  1. I have only Chrome browser, but by using this code the output showa all types of browser information like Safari, Mozilla.

    Why ?

    ReplyDelete
    Replies
    1. "Mozilla" is the application code name for Chrome, Firefox, IE, Safari, and Opera.

      Delete
  2. Thanks for your great post. This clears the understanding the concepts usuability of browsers. How to geek all aspects of browser's configurations and their valus to get inject with our development.

    Here is a similar posts about JavaScript Browsers Handling:
    http://www.namasteui.com/javascript-browsers-handling/

    Hope all of you like it. Thanks.

    --
    Regards,
    Sourav Basak [Blogger, Entrepreneur, Thinker]
    Namaste UI

    ReplyDelete