My First AJAX project

One of the things which I feel has held back some of my web applications from their true potential has been my lack of javascript knowledge, and AJAX methods especially. I finally decided to do something about this, so I bought a book “AJAX and PHP” from Amazon last week. It arrived this past Friday and I’ve been having a blast learning this technology.

Happily, AJAX isn’t anything technically “new” it’s just a way of using 2 languages that I already have a grasp of. After playing with the examples in the book, I decided to get my feet wet by converting one of my old scripts into AJAX in order to improve its speed.

Basically, this was a component of EdocWizard (mentioned here) which allowed people to select the appropriate subjects for their eDocs. The subjects are all based on what are called BISAC codes, which simply stands for Book Industry Standards And Communications. The official list of codes can be found at the Book Industry Study Group’s website. I have them backed up to my database, and there’s currently just over 3000 different codes recognized. Amazon allows publishers to pick up to 4 subject codes for each eDoc.

These subject codes are broken up into categories, and originally, I simply made the user wait while the entire 3000+ codes were copied from the database into javascript arrays, and then I had functions that could switch out the display to show the appropriate subjects based on the category the user had selected. My intent was to make it fast to switch between categories without forcing a page reload. It worked, but depending on connection speed it could take a long time for the complete page to finish loading. In retrospect, I should’ve simply forced a page refresh.

Anyway, none of that matters now that the tool has been converted to use AJAX. Check it out by using the form below.

October 08 2007 12:00 am | ajax and php projects

Comments are closed.