views:

743

answers:

6

I’ve been using a jQuery to do the whole ajax magic in my web based applications. But I came to a decision that I don’t need all these amazing features jQuery has, except its ajax functions (like $.ajax(), $.get(), $.post, getJSON() and load();).

Can you recommend a lightweight crossbrowser ajax library/framework (upto ~10 kb)? Thanks in advice.

+2  A: 

If you need to use ONLY ajax features take a look at sajax or custom MooTools. Of course, if you are a "lightweight freak" you can write your own routine for this (should be less than 50 lines)

Ionut Staicu
@ Staicu Ionut, thanks. I've just tried to build a MooTools based one, but it's still too big. Sajax is a server-side based one, in my case it's not that I want ajax framework to be. I've found jx, which is a very lightweight one and seems it supports json. Need to look.
Nordelius
A: 

Ajax can't be server side :) It make no sens though ;)

Ionut Staicu
yes, you are quite right! I meant to say: Sajax uses server-side code to generate javascript stuff.
Nordelius
@Staicu, you should have posted this is as a comment.
Robert S.
+1  A: 

MochiKit might fit your needs: http://mochikit.com/

Although lightweight and powerful it might not meet the 10kb requirement (you can trim it down to only the async module)

The equivalent methods would be:

  • doXHR

  • doSimpleXMLHttpRequest

  • evalJSONRequest

  • loadJSONDoc

  • sendXMLHttpRequest

EoghanM
+1  A: 

Really lightweight there is SACK (Simple AJAX Code Kit) I don't use myself but it looks really simple

edit : I checked, the js file is about 5kB

Vinze
+4  A: 

You can make jQuery smaller by removing the modules you don't need / Just modify the build.xml file.

Mark Spangler
A: 

MooTools...!!

Don't believe the jQuery guys ... ;)

Thomas Hansen