Thursday, August 1, 2013

How to identify Browser using Javascript

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

No comments:

Post a Comment