Sponsered Links
Categories
Sponsered Links

Javascript Browser Detection Techniques

 

This example show how to detect Browser name and Browser version using javascript.

 <html>

<head>
<title>Browser Detection Techniques</Title>
<Script Language="JavaScript">
browser_name=navigator.appName;
if (browser_name.indexOf("Netscape")!=-1) {
browser_name="NS"
} else {
if (browser_name.indexOf("Microsoft")!=-1) {
browser_name="MSIE"
} else {
browser_name="N/A"
}
};
browser_version="0";
if (navigator.appVersion.indexOf("2.")!=-1) {
browser_version="2"
};
if (navigator.appVersion.indexOf("3.")!=-1) {
browser_version="3"
};
if (navigator.appVersion.indexOf("4.")!=-1) {
browser_version="4"
};
if (navigator.appVersion.indexOf("5.")!=-1) {
browser_version="5"
};
if (navigator.appVersion.indexOf("6.")!=-1) {
browser_version="6"
}; 
</script>
</head>
<body>
<h1>Browser Detection Techniques</h1>
</body>
</html>

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved