It does Ajax, nothing more, nothing less - Teucer
For a long time, if i needed Ajax functionality in a HTML/JavaScript Application I’d just have thrown in the current release of jQuery and used its very nice Ajax methods.
Well, jQuery is in fact totally abso-f***ing-lutely awesome as a complete JavaScript framework. It given you every tool you need to build really great user interfaces for web appllications. But what if you just need something that simplifies this whole Ajax stuff?
I looked around a bit and wasn’t quite satisfied with thee major JavaScript frameworks out there. They all seemed to be too big and complex. So I thought to myself: “You already have written this Ajax stuff somewhere. Gather it together and make your own Ajax library!” And so I did …
Behold! The Teucer Ajax library, hosted on bitbucket.org. I uploaded version 0.1.0 last night as a first testing release in addition to the complete source repository. The source version can be downloaded here and there is also a compressed version if you just want to use it without peeking into it’s internals. If you want the complete development package, including a test page with common test cases, you can clone the entire repository with Mercurial.
You’re welcome to test it and study the source code. I would very much appreciate every bit of feedback from “Awesome!” to “Damn, this is stupid because … !”. Just don’t forget the “because …” ;)
A more comprehensive guide on how to use Teucer is available in the project wiki but basically this is how it works:
new Teucer( "http://example.org/" ).execute( function (data) { alert(data); } );
This will asynchronously load the content of “http://example.org” and display them in a dialog box after it’s done loading.
Teucer is designed to be used with a jQuery like Fluent Interface for more complex requests:
var data = new Teucer( "http://example.org/" )
.synchronous()
.post()
.addHeaders( {myheader: 'foobar'} )
.addParams( {text: 'Some text...'} )
.execute();
This will perform a synchronous POST request with a custom HTTP header and parameters in the request body. You’ll find more about all the chained methods in the project wiki.
Be warned! This is a preview of unfinished software. It may be full of dangerous bugs, incomplete features and man eating dragons. Use at your own risk!
Feel free to try out Teucer and stay tuned for updates. I’m already working on additional features and performance optimization. Any future releases will be published over the bitbucket.org repository at http://bitbucket.org/techpriester/teucer.
Have fun with it…