One of my favorite AJAX frameworks has been and still is, JPSpan. But as it is, it does have a few minuses, which I've managed to eliminate.
I've hacked away into the source of the JPSpan framework and added three new features: support for Opera 8.5+, JSON encoding for transfer and global Init and Complete event handlers.
JPSpan meets Opera
The original code for JPSpan for creating the XMLHttpRequest object did not support Opera, which is a downside. I've modified the code to support Opera from 8.5 upwards.
JSON encoding
The JS generated by the server end of JPSpan is too large in size. The same data could be sent with JSON in less than a third of size of the JS generated by JPSpan. Another minus I wanted to and did fix. JPSpan was build in mind for extensibility, and it was rather easy to integrate a new encoding format, which you've guessed it to be JSON.
Now both request and response data will be sent in JSON.
Global Init and Complete event handlers
If you've used JPSpan before you know how the calls are made and how the responses are handled. If not I'll describe it in a few words. Every call will be made through an object which will have to be created in association with a handler. Thus when calling method X, the response will trigger method X on the handler assigned to the calling object.
The problem is there was no kind of global Loading and Complete event support, for displaying visual feedback that an ajax call is currently happening such as a "Loading" area. Now this issue no longer exists. There is support for two method on the handler associated with the calling object. onInit, if defined, fires at the start of every call. And onComplete, fires after the results have been received.
To view a demo of these features just view this test page.
To download the files of JPSpan with these new features and the example also: jpspan-2.0.zip [59 Kb]
Comments
at 23:49 on 21/Aug/2006
![]()
at 14:26 on 09/Jul/2007
![]()
at 01:54 on 09/Jun/2006
Comment by Mark