AJS is a ultra lightweight JavaScript library that is around 2 years old. It is inspired by MochiKit, but differs by being small and expressive. The current version is only 33 KB (uncompressed!), whereas MochiKit and other libraries such as JQuery, Mootools or Prototype is over/around 100 KB.
AJS includes:
* Powerful and easy to use AJAX functions
* Performance on almost everything
* Effects
* Drag and drop
* Functional programming such as AJS.map, AJS.partial
* DOM functions such as AJS.$
* AJAX JSON support (with AJS.loadJSON and AJS.serializeJSON)
* Unified position and size that works in all the modern browsers
* Unified events that work in all the modern browsers
* and a lot more…
But that’s not all! AJS also features:
* Only ONE namespace is used, namely AJS
* Documentation and examples on all functions
* Polymorphic – A Python script can scan your code, find the AJS functions you use and create a special AJS file for you that is MUCH smaller!
Code snippets
Creating DOM smartly
var p_elm = P(SPAN({class: 'blue_n_black'}, IMG({src: 'hottie.gif'})));
Expressive
//Delete all span elements with class “name” and fluffy_id element
removeElement($bytc(’span’, ‘name’), $(’fluffy_id’));
AJAX done easily
function doSearch() {
var url = "http://api.search.yahoo.com/";
var d = AJS.loadJSON(url);
d.addCallback(function(o) { alert(o); });
d.addErrback(function(err) { alert(err); });
var form = AJS.$('formy');
d.sendReq({appid: "YahooDemo",
query: AJS.$f(form, 'q').value,
results: AJS.$f(form, 'r').value,
output: "json"})
return false;
}
Effects
AJS.fx.setHeight(AJS.$('div'), {from: 0, to: 500});
Documentation
* AJS reference – Use this to get an overview over functions that AJS provides
* AJS.fx reference – Use this to get an overview over effects
* AJS.dnd reference – Use this to get an overview over drag and drop
Examples
* Simple drag and drop
* AJS.fx show-off
* JavaScript OOP
* Sortable list
Demo: http://lab.digimute.com/
Download: http://orangoo.com/labs/uploads/AJSv4_5.zip
Source: http://orangoo.com/labs/AJS/

Related Listings:
No comments yet.
RSS feed for comments on this post. TrackBack URL