AjaxEvent JS Class
- Project Goals
- I needed a concise way to create and manage AJAX requests for use on my personal website. As a learning exercise, I decided to write my own Javascript class to encapsulate this functionality.
- Skills used
- Javascript, XML, HTML
- Details
-
I'd originally built my iBOB Mailing List Reader using
frames; later -- once I learned a bit about AJAX techniques -- I decided
that route would provide a more elegant interface...plus reworking the iBOB Reader to use AJAX would
serve as a great learning platform. I looked into a few of the available AJAX platforms and frameworks,
and quickly realized that they were a bit overwhelming -- I felt that I really needed to get a basic
understanding of what was going on with the XMLHTTPRequest object before adopting one of those.
So, I created a custom AJAX Javascript class to encapsulate the functionality I needed.
Currently the class supports instantiating multiple XMLHTTPRequests per page, where each object gets a unique ID. This ID is used to block and abort duplicate/overlapping calls; eventually I plan to add queueing and request-management functionality to prevent multiple, simultaenous XMLHTTPRequests from overwhelming the browser. This issue is something I'm currently curious about, and while I've read several articles stressing the importance of efficiently managing the number of connections to the server created by the client, I've found surprisingly little in the way of code examples mirroring this concern (It seems a lot of folks just rely on the whatever the inner workings of the browser are). As such, the AjaxEvent class is a work in progress.
- Examples/Links
- http://www.yojimg.net/bike/ibob/ (the iBOB Reader)
- Selected Source Code
- AjaxEvent JS Class