navigator.userAgent
it will give the client browser information and accornding to that we can identify the browser.
Let see an example, like if we want to know is this browser Chrome or not then we can
use this conditions..
if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
{
alert("it is chrome");
}
else
{
alert("it is not Chrome");
}
Thanks
it will give the client browser information and accornding to that we can identify the browser.
Let see an example, like if we want to know is this browser Chrome or not then we can
use this conditions..
if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
{
alert("it is chrome");
}
else
{
alert("it is not Chrome");
}
Thanks
No comments:
Post a Comment