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
Leeds, United Kingdom | UKCRN
Portal Systems Administrator, Leeds As part of this crucial team, your responsibilities will include the support and maintenance of the Portal to support both national research programmes and non-research activities. Systems administration will occupy much ... more >
London, United Kingdom | MI5
Finance and Procurement Business Analyst, London, From £30,192 depending on skills and experience (pay award pending) As part of MI5's support team for the Oracle eBusiness Suite, you'll be supporting colleagues as they protect the ... more >
Leeds, United Kingdom | UKCRN
Portal Manager, Leeds In charge of the Portal Management team, you'll manage the day to day operations of the portal and provide editorial function and guidance.  You'll understand and own the portal's strategic aim and ... more >
Leeds, United Kingdom | UKCRN
Helpdesk Manager, Leeds You'll have the opportunity to develop a dedicated Help Desk Service so that services are clear, accountable and responsive to customer needs.  Planning, monitoring and controlling the use of helpdesk resources, you'll ... more >
More job opportunities