Monday, March 3, 2008

Javascript in a really really small nutshell

Javascript is a scripting language. What that usually means is that it's not pre-compiled upon execution unlike C++ or Java. Instead it's dynamically executed on the browser after receiving the scripted code from the server. This means one can hijack the code before it gets executed on the browser. Not a problem most of the time since Javascript has limited access to your local resources (can't write to your hard disk).

Javascript is object oriented in nature but doesn't follow classical inheritance like C++, Java or Ruby but have prototypal inheritance instead.

Javascripting can be looked at from two perspectives although they're not mutually exclusive:

1. Core javascript
2. DOM (Document Object Model)

Core javascript will cover the fundamental properties of javascript objects and also functions and methods available to create and extend objects.

DOM enables HTML/ XHTML webpages to be looked upon as "documents". DOM methods enables manipulation of these documents to achieved a desired effect on the browser, whether it's creating/ populating content or animating snazzy effects.

Modern Javascripting has sprung many popular frameworks/ libraries/ apis that attempts to standardised/ extend basic javascript funtionalities. The following is a non-exhaustive list:

prototypejs, scriptaculous, jquery, mootools, moofx, mochikit, extjs, domassistant, json.js

One can use there libraries as a headstart but must bear in mind that they only serve to extend what was already there in the core/ dom javascript and also the issues that these frameworks have. Most of the time it's a good idea to one of them for your project as they usually have already smoothed out some of the implemantation differences in javascript on the major browsers, ie. Firefox, IE, Opera, Safari, etc.

Welcome to {Object: Literal}

var greetings = {say: "hello"};

Basically this is an attempt to define all things javascript from beginner to advance and hopefully, down the road of my programming journey, masterclass.

There will first be a focus on javascript core and tutorials on ExtJs framework. Hope it helps those who wants to know Javascript/ ExtJs better.