jx - JavaScript Ajax Library
jx is a small toolkit for providing AJAX support in JavaScript. It has two different version - jx and jxs.
jx - Lite Vesion - V3.00.A
This provides the most basic Ajax support. It is striped down to minimise file size - so it will not support many advanced features. You can pass data to the server side script using the GET method only. The supported return types are plain text and JSON. It does NOT support XML return.
See a line by line explanation of what the code does...
Demo
jx Demonstration.Features
- Supports GET method
- Supports JSON.
- Small Size (>1 KB compressed / 2.3 KB with all the comments)
- Very easy to use.
Samples
jx.load('demo.php?dummy=text&lorem=ipsum',function(data){
alert(data); // Do what you want with the 'data' variable.
});
For more samples, see the jx Demonstration page. Code is provided for more advanced uses of jx like using JSON returns.
Code
Source - jx.js File
Compressed Source File
Take a look at the explanation page to see what happens in the code.
jxs - jx excess - V2.01.A
This is a slightly larger version of jx - hence the name j excess. It supports many features that the lite version don't support. The file size is slightly bigger - but its worth it.
Features
- Supports both POST and GET methods
- Supports XML return.
- Supports customizable loading indicator display
- Automatically update a given element with returned text.
- Customizable
onReadyStateChange
handler - And more...
Demo
jxs Demonstration.Code
Source - jxs.js File
Compressed Source File