image: mozilla developer centre
The Mozilla developer centre is among the best Javascript resources on the web
R E L A T E D   C O N T E N T
ADVERTISEMENT

Hands on: Javascript comes of age

Adobe’s muscle is taking Javascript beyond simple web scripts

Tim Anderson, Personal Computer World 28 Mar 2007
ADVERTISEMENT

In 1995 a programmer called Brendan Eich joined Netscape Communications.

Netscape “was looking for someone to work on a scripting language or some kind of language inside the browser that could be used to automate parts of a web page or make a web page more dynamic”, wrote Eich in an article on Netscape’s website.

The language was initially called Mocha, then Livescript, and finally Javascript, in a deliberate attempt to ride the waves of Java’s success.

The name still causes confusion, since Javascript is completely different from Java. Microsoft attempted to derail it with VBscript, but this was not implemented by browsers other than Internet Explorer, making Javascript the only choice for scripting web pages.

Javascript was standardised by ECMA, a European standards body, and the official specification is called ECMAscript. Microsoft’s implementation is called Jscript, while Adobe has a version running in Flash called Actionscript.

Javascript is widely used, but not really loved. There are many compatibility issues, mainly with the document object model presented by different browsers. Javascript developers have to learn tricks to get code working everywhere. These issues, combined with the perception that Javascript is only for scripting, meant that few developers attempted to use Javascript for substantial applications.

This is changing and Javascript usage is growing fast. The first key factor is the rise of Ajax, where web applications have extensive client-side script to give users a richer, more seamless user interface.

The second factor is the use of Flash for applications beyond multimedia effects. Adobe’s Flex product, soon to be joined by a related project called Apollo, lets you code for Flash with XML and Actionscript, which is easier for developers than the designer-oriented Flash IDE.

Object orientation
Javascript has long supported object oriented programming, although if you only use it for scripting web pages, you might not have explored this part of the language. Javascript is a dynamic language, allowing a free and easy approach where properties are created on the fly. For example, if you were writing code to manage a magazine archive, you might have something such as this:

mag = new Object();
mag.name = "PCW";
someLabel.innerHTML = "The magazine name is: " + mag2.name;

This code creates a new object, adds a property on the fly, and then references it. You can even add methods in similar style:

function describe()
{
return "The magazine name is: " + this.name;
}

mag = new Object();
mag.name = "PCW";
mag.getdescription = describe;
someLabel.innerHTML = mag2.getdescription();


All Online
Tags: Visual Programming

Like this story? Spread the news by clicking below:

Post this to Delicious del.icio.us    Post this to Digg Digg this    Post this to reddit reddit!

Permalink for this story
R E A D E R   C O M M E N T S
M A R K E T P L A C E
Get your free demo of Numara Track-It! 8 - the leading help desk solution for IT related issues.
Make presentations, review documents & share your entire desktop. 30-day free trial! (cc required).
Discover how remote support can fuel your IT business in ways you've never thought of before.
Apply ITIL best practices at your service desk while eliminating integration cost. Learn more here.
WAN based, automated, daily vulnerability assessments. Click here to try and request our whitepapers.
Have your product or service listed here >   
Sponsored links
F E A T U R E D   J O B S
United Kingdom | Advent Computer Training
Are you stuck in a dead end job? Do you want to take control of your salary, life and career? Advent IT and computer training offers advanced, professional training and helps you find the right ... more >
Hertfordshire, United Kingdom | Tesco.com
Solution Architect Lead Hertfordshire Who's behind the world's most successful online retailer?Just over 10 years ago we started Tesco.com (aka Dotcom). Today, we've an incredible 750,000 active customers and sales at just under £1 billion. We ... more >
Berkshire, Reading, United Kingdom | Foster Wheeler
Sharepoint Administrator - Competitive Salary - Reading Foster Wheeler is a leading international project management, engineering and construction organisation with global construction capabilities working on major projects within upstream oil & gas, midstream & LNG, ... more >
Welwyn Garden City, Hertfordshire, United Kingdom | Tesco.com
Middle Tier solution Designer - Welwyn Garden CityWho's behind the world's most successful online retailer? Just over 10 years ago we started Tesco.com (aka Dotcom). Today, we've an incredible 750,000 active customers and sales at ... more >
More job opportunities