Forum : Browser Detection
Brief description  about Online courses   join in Online courses
View Mansoor  Ali 's Profile

Browser Detection

I didn't understand the 3rd task in the 2nd Javascript assignment.

It says "Get the browser information and accordingly change the background color of browser."

Can anyone describe me the task and let me know what to do?
Asked by Mansoor Ali | Apr 30, 2010 |  Reply now
Replies (1)
View abdulhaq syed quadri 's Profile
Here is the program my friend



<html>

<head>

</head>
<body>

<input type="button" Value="Browser Name" onclick="alert(navigator.appName), document.bgColor = 'Blue'">
<input type="button" Value="Browser Version" onclick="alert(navigator.appVersion), document.bgColor = 'Red'">
<input type="button" Value="Cookies Enabled" onclick="alert(navigator.cookieEnabled), document.bgColor = 'Green'">
<input type="button" Value="Platform" onclick="alert(navigator.platform), document.bgColor = 'white'">
<input type="button" Value="User-agent header" onclick="alert(navigator.userAgent), document.bgColor = 'yellow'">

</body>
</html>

Enjoy.
May 1, 2010