C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

Javascript code to get browser details


Posted Date: 01 Oct 2008    Resource Type: Code Snippets    Category: Javascript
Author: Vishnu K JMember Level: Gold    
Rating: 1 out of 5Points: 10



Add this code in the script section of the html page to get the browser details


function getBrowserName() {

document.forms[0].elements[0].value =navigator.appName;

}



function getBrowserVersion() {

document.forms[0].elements[0].value = navigator.appVersion;

}



function getBrowserCodeName() {

document.forms[0].elements[0].value = navigator.appCodeName;

}



function getBrowserUserAgent() {

document.forms[0].elements[0].value = navigator.userAgent;

}



function getBrowserNameVersion() {

document.forms[0].elements[0].value = navigator.appName + " " + navigator.appVersion;

}


Add the tags below inside the form element of body tag

<INPUT TYPE="button" VALUE="appName" onClick="getBrowserName()">
<INPUT TYPE="button" VALUE="appVersion" onClick="getBrowserVersion()">
<INPUT TYPE="button" VALUE="appCodeName" onClick="getBrowserCodeName()">
<INPUT TYPE="button" VALUE="userAgent" onClick="getBrowserUserAgent()">


<INPUT TYPE="button" VALUE="appName / appVersion" onClick="getBrowserNameVersion()">



Responses

Author: Chetankumar Digambarrao Akarte    10 Mar 2009Member Level: Gold   Points : 2
Hello Friends!

Here is a good example on "Getting Browser details and Version Detection using JavaScript"

http://www.xfunda.com/index.php?option=com_content&view=article&id=63&catid=40&Itemid=75

Also Test the script online-

http://www.xfunda.com/demo/Browserdetails.html

Regards
Chetankumar Akarte


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Get browser details using javascript  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: MobileNumber Validation using javascript
Previous Resource: Creating Calender Using Java Script
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use