Introduction to Javascript

Monday, April 2, 2012

JavaScript was created in 1995 by Brendan Eich, an engineer at Netscape. It was first released with Netscape 2 in 1996. The original name was called LiveScript, but was renamed to JavaScript. Netscape soon after, submitted the language to Ecma International, which is a European standards organization. This submission resulted in the first edition of the ECMAScript standard to be adopted in 1997. The ECMA standard, also known as ECMAScript-262 was approved as an international ISO (ISO/IEC 16262) standard in 1998.

JavaScript vs Java

JavaScript and Java are not the same thing, nor are they related. Although the names similar, JavaScript is a scripting language for use within HTML pages, while Java is a programming language developed by Sun Microsystems. Aside from their names being similar, both JavaScript and Java are object oriented languages. That is pretty much the extent of their similarities. Ever since the original name was changed to JavaScript, the confusion between JavaScript and Java has existed.

What is JavaScript?

Now that we know that JavaScript is not Java, then what is it? JavaScript is an object oriented dynamic language. So this means that it has types and operators, core objects, and methods. Its syntax is similar to that of the C languages, so many of the structures from those languages apply to JavaScript as well. However, you should note that JavaScript does not have classes. Also, its functions are objects as well. This gives the functions the capacity to hold executable code and be passed around like other objects. Even though you can use JavaScript to write complex programs, its not usually required when using JavaScript in conjunction with HTML. Fortunately, for the majority of its uses, it is easy to learn and implement.

What can JavaScript do for me?

The main goal of JavaScript when used by HTML developers is to use it as a programming tool. While many HTML authors are not programmers by trade, integrating JavaScript into their projects is not a daunting task. JavaScript is easy to learn and implement. Its syntax is not difficult to understand. Since JavaScript is widely accepted and used, any HTML developer can find snippets of code published all over the internet. One very nice feature of JavaScript is that it can react to certain events. For instance, you can have JavaScript code execute when something happens, such as when the web page finished loading or when a user clicks on an HTML element. JavaScript can also easily read and write HTML elements. This is a very nice feature when you need to change the content of an element based on a certain event. Web developers have also used JavaScript to validate data. This is very important for a web developer to validate form data before it is submitted to a server. This ensures that prior to data being passed back to the web server for processing, the data has passed an initial review of the content. Another key factor of JavaScript is that it can be used to detect the visitor's browser. For example, a web developer may want to detect the browser type so that a different variation of the page can be displayed for an optimal user experience. Finally, JavaScript can be used to create cookies. This allows a web application to store and retrieve information on the visitor's computer. This can be very helpful for a shopping cart application.

Before you continue to read through the following JavaScript tutorials, you should make sure that you have a basic understanding and are comfortable with HTML and CSS core concepts.

Did you find the page informational and useful? Share it using one of your favorite social sites.

Recommended Books & Training Resources

Professional JavaScript for Web Developers JavaScript and jQuery: The Missing Manual HTML CSS and JavaScript Editor