Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
I have to find the browser type which I am using.
Is there is any method in apex to do this.
Thanks in advance.
Regards,
Pratty
Hi Pratty ,
You can find the browser details by using javascript in your visual force page. Here is the sample code :
<apex:page ><div id="browserid"></div>
<script type="text/javascript">
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";txt+= "<p>Browser Name: " + navigator.appName + "</p>";txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";txt+= "<p>Platform: " + navigator.platform + "</p>";txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("browserid").innerHTML=txt;
</script></apex:page>
Please mark it as the solution if it answers your question and if you have any question, let me know.
Ckeck My Blog
Hi Pratty,
You can find the browser name and other details using the "User Agent", which can be easily accessed by Javascript.
You can find the complete detail at W3School website, Here is URL:
http://www.w3schools.com/js/js_browser.asp
Working Demo :
http://www.w3schools.com/js/tryit.asp?filename=try_nav_all
Check the following example :
<!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" xml:lang="en" lang="en"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><title>JavaScript navigator object - appCodeName property example</title></head><body><h1 style="color: red">JavaScript navigator Object : appCodeName property</h1><hr /><script type="text/javascript">//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[document.write("navigate appCodeName property : " + navigator.appCodeName);//]]></script></body></html>
Reference: http://bit.ly/wgu4cX
Hi Pratty ,
You can find the browser details by using javascript in your visual force page. Here is the sample code :
<apex:page >
<div id="browserid"></div>
<script type="text/javascript">
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("browserid").innerHTML=txt;
</script>
</apex:page>
Please mark it as the solution if it answers your question and if you have any question, let me know.
Ckeck My Blog
All Answers
Hi Pratty ,
You can find the browser details by using javascript in your visual force page. Here is the sample code :
<apex:page >
<div id="browserid"></div>
<script type="text/javascript">
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
document.getElementById("browserid").innerHTML=txt;
</script>
</apex:page>
Please mark it as the solution if it answers your question and if you have any question, let me know.
Ckeck My Blog
Hi Pratty,
You can find the browser name and other details using the "User Agent", which can be easily accessed by Javascript.
You can find the complete detail at W3School website, Here is URL:
http://www.w3schools.com/js/js_browser.asp
Working Demo :
http://www.w3schools.com/js/tryit.asp?filename=try_nav_all
Check the following example :
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>JavaScript navigator object - appCodeName property example</title>
</head>
<body>
<h1 style="color: red">JavaScript navigator Object : appCodeName property</h1>
<hr />
<script type="text/javascript">
//This is done to make the following JavaScript code compatible to XHTML. <![CDATA[
document.write("navigate appCodeName property : " + navigator.appCodeName);
//]]>
</script>
</body>
</html>
Reference: http://bit.ly/wgu4cX