Nima Dilmaghani’s Technology Blog

Clientside browser sniffing via Microsoft Ajax Libraries

Posted in Uncategorized by nimad on August 4, 2007

switch(Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
alert(“IE”);
break;
case Sys.Browser.Safari:
alert(“Safari”);
break;
case Sys.Browser.Opera:
alert(“Opera”);
break;
case Sys.Browser.Firefox:
alert(“FF”);
break;
default:
alert(“default Browser”);
}

Easy? Do I need to say anymore?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: