Adobe Developer

Sunday May 20, 2012



JavaScript

JavaScript is a client side scripting language (meaning it runs in your web browser) and is useful in all sorts of ways. Do not confuse javaScript with the Java language, which is a server side language. One has nothing to do with the other, outside of the fact they share the word java. One of the most common uses for JavaScript is browser detection. Browser detection is necessary because how a browser renders a web page varies by browser type and version. Thankfully, adherence to standards has improved in recent years vs the early days of web programing (recall the wars between Internet Explorer and the old Netscape)and we have javaScript to actively manage browser detection and deploy solutions.

Here are the javaScript properties used for identifying the client's browser

navigator.appCodeName
returns the Browsers Code Name i.e. "Mozilla"
navigator.appName
returns the Name i.e. "Microsoft Internet Explorer"
navigator.appVersion
returns the browser version (e.g. 3.0, 4.0, etc..) "
navigator.userAgent
returns the header information (a long string)"
navigator.platform
returns the Operating System"

Here is a javaScript object oriented script using the javaScript properties for identifying the client's browser

function Is() {
   this.codeName = navigator.appCodeName;
   this.browserName = navigator.appName;
   this.browserVersion = navigator.appVersion;
   this.browserHeaderInfo = navigator.userAgent;
   this.operatingSystem = navigator.platform;
}
var is = new Is();

Here is the Browser Detection Information for your Browser

Browser Code Name is:   

Browser Name is:   

Browser Version is:   

Browser Header Info is:   

Operating System is:   

About Action Marketing Media

We are all about making ideas come to life -your ideas, and we will realize them together utilizing new and exciting technology.

Action Marketing Media is a development studio founded by John Tomai, a web developer with 15 years experience and a passion for creating online media.