Blunt AJAX Request Handler JavaScript Class
(Dirty Little AJAX Handler)

This script used to be called HAJAX and was available from another Web site. You may have been redirected here from that site and you are in the right place. This class is, I believe, a significant improvement on the old Hajax class. However, that class and this one are not comparable.

Download (Total Downloads: 53)
Documentation
Examples

This class came out of the need for a simple ajax processor that would handle making the connection to the server and receiving the response. I know JavaScript and I really had no need of a tool that would do more than this simple basic function. I looked for some existing tool to do the job, but had little luck. When I found something simple it could not handle multiple, simultaneous requests. On the other end of the spectrum were the Ajax and JavaScript frameworks that tried to be everything to everyone and as a result you basically needed to learn a completely new language to understand how to use it. While written in JavaScript, most of the tools available have their own rules and syntax. They have ceased to be JavaScript. This is because the people that write such tools have in essence created their own sub-language. I don't simply cannot understand why people need to take something so simple and turn it into something so difficult.

I don't know how it is with other developers, but I simply do not have the time to learn all the obscure classes, functions, and what-have-you to become efficient with the use of such frameworks. The demands on my time are many and I need to get the job done and move on to the next one as quickly as possible. I know JavaScript and I really don't need a tool so that I can use it. What I need are tools that will make my job easier, make me more efficient and help me get the job done. If I have to spend a week or more learning how to use something new then I've just wasted that time and in most cases I could have simply written something myself in less time.

Finally, I just wrote something myself. The result is this very small Javascript class. It does exactly one thing, and only one thing, it handles the communication with the server. That is, it makes a connection to a server, sends a request to the server and receives the response. Unlike the other frameworks available out there, this tool does very little, but it does exactly what I need it to do.

Before you even look at the tool, do not expect that it will handle more than what is stated above. If you wish to do something more complex than alerting the server response or stuffing the response into a page element then you must write the functions that will call the class and then you must write the functions that deal with what is returned from the server. But, if you, like me, know JavaScript well enough that these tasks are not an issue, then you may want to give this a try. The code is well documented with explanations detailing all of the parameters and how to write simple functions to use the class. There are also examples and additional documentation available (see the links to the left).

The class can handle multiple simultaneous connections. As far as I know there are no limits to the number outside of the number of connections that a browser itself is allowed to have open.

If you find this script useful, please let me know and if you have the inclination, a link back to this page would be greatly appreciated. Also, if you have any input about this script or you find a bug, please let me know that as well. I am not against making improvements in it as long as these improvements do not change the original goal I had when I wrote it of performing only the single task of communicating with the server.