Header

Wednesday, 23 May 2012

How to identify Browser using Javascript

Hi Friends,

We will see how we can get the client browser information.

Let see an example, like if we want to know is this browser Chrome or not then we can

In JavaScript we have object which will let us know the information of client browser.

//navigator.userAgent


 if( navigator.userAgent.toLowerCase().indexOf('chrome')>-1)
{
alert("it is chrome");
} 
else
{
alert("it is not Chrome");
}

In the above we are checking the name of Browser in the same way you can find the name.






2 comments: