Well, I decided to put together my own XMLHttpRequest wrapper. Not because we don’t have enough choice already but mostly because:
- I needed some Javascript practice (without using a framework like mootools)
- I wanted to learn more about the XMLHttpRequest object
- I love mootools and prototype’s XMLHttpRequest wrapper and wanted something similar without having to use a whole framework
- I was bored
- The current star alignment told me to do so
It’s still an early draft but so far it features:
- Support for most browsers (Firefox 2&3, IE 5, 6 & 7, Opera, Safari 2 & 3)
- The ability to securely evaluate JSON responses
- POST and GET requests
- Timeout
- Pseudo-Events (i.e. you can provide callbacks for onComplete, onSuccess, onFailure and onTimeout)
- Add/Remove custom headers
- Update any element with the response text
- …
The code, partial documentation and more can be found at my wikidot:
http://silverscripting.wikidot.com/silverajax
A demo will follow shortly…