Creating an AJAX library

This is my first post chronically my trials and triumphs as I try to put together my own AJAX library, largly inspired by the Yahoo! library but also freely adapting from any good ideas I find on the web or in books.

So why not just reuse the Yahoo! library or any of the other excellent libraries out there? If I ever need to build a heavily trafficked site or work with a team of developers then yes, I’ll probably use one of the existing libraries. But for now, writing code for myself, I want to learn how to write object oriented javascript and the best way to learn is to try and do it myself.

A little bit of background – I started playing around with HTML in the mid-nineties and managed to find work where all I need to know was how to turn a Photoshop design into a web page. CSS back then wasn’t used, and if I need Javascript I copied and pasted it from one of the many Javascript sites that existed for jus that purpose.

Eventually I started migrating over to CSS, and went from creating web sites with lots of tables, to writing web sites with lots of tables with lots of cells with their own classes, to writing tableless layouts with a minimum number of classes. I also took a Cold Fusion class, which was my first introduction to programming. Beside learning the Cold Fusion syntax, I also learned the concepts of programming, which I never knew up to then. Once I learned those concepts I was also able to learn ASP and then PHP.

And then the web became object orientated.

For the longest time I thought writing object-orientated code on the web was a waste of time, and then I build an e-commerce site in PHP using my own checkout system and had to edit it later and that’s when I realized how fragile a system built on a bunch of inter-dependent functions can be, especially when the functions are also producing HTML.

So I’m starting to use object-orientated programming in PHP and learning ASP.NET and now it’s time to use these same techniques in JavaScript. I’m developing a proof of concept site for my job and I recently threw out all the work I had done up to this point and am starting over, this time buidling it as a AJAX-heavy site with customer AJAX libraries to make it all work. There is no reason for the site to use AJAX or any of the gratutious effects I’m building into it, but it’s a learning excercise, so I’m allowed to create a horrible UI and learn from my mistakes.

Leave a Reply