Like everyone else, when I started dabbling in AJAX code I found myself repeatedly creating the same code to do the same things. There was always code to make sure I could create the XMLHttpRequest if it was there, or the Microsoft equivalent for the awkward browser. There was always event code to process, sometimes repeatedly, the response codes until I got a 4. There was usually code to present some visual indication to the user that there was a call in progress.
Now, like other programmers, if I find myself doing the same thing over and over again, it's time to write a library.
These holes were filled by numerous framework libraries for doing all sorts of things. Be it filling in some small missing functions like addAfter to compliment addBefore, or extra trim functions for strings as you would find in PHP, there were, and still are, numerous choices.