Monday, October 15, 2007

Browser detection in javascript

var browserName=navigator.appName; 
if (browserName=="Netscape")
{
alert("Hi Netscape User!");
}
else
{
if (browserName=="Microsoft Internet Explorer")
{
alert("Hi, Explorer User!");
}
else
{
alert("What ARE you browsing with here?");
}
}

No comments:

Post a Comment