My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

An AJAX framework for developing pure AJAX applications like gmail or google maps. Development of your application is kept in logical order, i.e. HTML for page content, CSS for your website style and JavaScript for your website’s functionality. The framework handles compiling your entire website into a single static JavaScript file that can be easily versioned and served from any web server.

Included in the source code is Class.js a light-weight Object Orientated JavaScript wrapper that lets you declare objects like this:

function Animal(firstName, lastName)
{
    Animal.$baseNew.call(this);

    this.firstName = firstName;
    this.lastName = lastName;
}
p = Animal.extend(Class, { type: 'Animal' });

//Declare your objects members in any 1 of 3 ways:
//1. Shortened proto, by using the returned prototype as an alias: 
p.hello = function(text)
{
    return "hellooo: " + text;
}

//2. Explicitly, by using your classes prototype
Animal.prototype.getFullName = function()
{
    return this.firstName + " " + this.lastName;
}


function Cat(catType, firstName, lastName)
{
    Cat.$baseNew.call(this, firstName, lastName);

    this.catType = catType;
}
Cat.extend(Animal, { type: 'Cat' }, {
    //3. like this
    hello: function(text)
    {
        return "meaoow: " + text;
    },
    getFullName: function()
    {
        return this.catType + ": " + Cat.$base.getFullName.call(this);
    }
});

Declaring instances of your classes is as straight forward as:

var animal = new Animal("Mr", "Animale");
var cat = new Cat("ginger", "kitty", "kat");

Which gives the following output:

animal.getFullName() Mr Animale
cat.getFullName() ginger: kitty kat
Animal.getType() Animal
Cat.getType() Cat
animal.getType() Animal
cat.getType() Cat
animal.getBaseTypesAndSelf() Animal,Class
cat.getBaseTypesAndSelf() Cat,Animal,Class
Class.createNew("Cat", ["tab","fat","cat"]).getFullName() tab: fat cat
animal.isTypeOf(Cat.getType()) false
animal.isTypeOf(Animal.getType()) true
cat.isTypeOf(Cat.getType()) true

Suggestions for improvements are welcome.

Live Examples of websites using Ajax Stack

To see a live-demo of what a website built using Ajax Stack can achieve check out:

Powered by Google Project Hosting