Supported: Internet Explorer 6+ Supported: Mozilla Firefox 2+ Supported: Apple Safari 3+ Supported: Google Chrome Supported: Opera 9+ Supported: Konqueror
→ Ease Your Way ←

AJAX.OOP is a fast and scalable JavaScript Library that provides you with possibility to create JavaScript/Ajax components in object oriented way.


It has best, full-featured and fastest OOP engine you can find over the Internet. AJAX.OOP provides you with possibility write your own classes, use inheritance, polymorhysm mechanisms and gives possibility of extending and reusing existing code.

Download latest release of AJAX.OOP



Download

Latest release version: 1.0.4 - Sunday, September 07, 2008

Example:    [run]    [run browser test]


// Native JavaScript style class definition
function Car( color, type) {
  this.color = color;
  this.type = type;
  this.drive = function() { alert( 'Car::drive() called!'); };
  this.init = function() { alert( 'Car::init() called!'); };
  alert( 'Car::constructor() called!');
};

// AJAX.OOP-style class definition with inheritance
var Suzuki = Ajax.Class( Car, //<- inherit class Car
{ // write definition of a child class:
  constructor : function( color) {
    this.$super.constructor( color, 'sedan'); //<- call parent constructor
    alert( 'Suzuki::constructor() called!');
    this.$super.init(); //<- call another parent method
  },
  drive : function() { //<- override parent method
    this.$super.drive(); //<- call parent method:
    alert( 'Suzuki::drive() called!');
  },
  turn : function( where) {
    alert( this.color + ' ' + this.type + ' suzuki has turned ' + where);
  }
});

// instantiate object:
var vehicle = new Suzuki( 'Red');
vehicle.drive(); vehicle.turn( 'left');

// check object hierarchy:
alert( 'vehicle is instance of Car: ' + (vehicle instanceof Car));
alert( 'vehicle is instance of Suzuki: ' + (vehicle instanceof Suzuki));

OOP Features:


  • Inheritance - you are able to inherit any JavaScript classes, even if they written not with AJAX.OOP syntax but with native javascript style.
  • Overriding - you are able to override any parent properties and methods in a way you like.
  • Parent access - you can easily call/access any parent properties or methods from anywhere in your class, even if parent elements has been overriden! Just use this.$super accessor of any class you've created with AJAX.OOP.
  • Agregate self and parent - you can instantiate self and parent classes inside themselves. Just use "new this.$_super()" and "new this.$_self()"
  • Strict instances - your objects are strict: "instanceof" and other built-in functionality will work propertly.
  • Fast engine - it's truth - try it!
  • Less code - OOP engine itself is really lightweight: ~30 lines (< 1KB) of a pure plain code.

Learn more >>



AJAX Requests Handling:


In addition this core will help you handle AJAX requests of different types. The package contains functionality to handle classic requests on a single domain and crossdomain requests functionality. Learn more >>