A Few things you Should Know About Ajax

1. Ajax is not an acronym. I have seen some people spell Ajax out as Asynchronous JavaScript and XML or Active JavaScript and XML. This is not true. XML is not required to create an Ajax application.

2. If you are running your own server then this will be important. Plan for an increase in HTTP requests. A poorly written application can bring a server to its knees. With normal HTTP traffic, you only send data when someone requests a new page, but with an Ajax application it is in constant communication with the server. Keeping the number of times your programs has to communicate with the server low will help prevent this issue. A few ways to accomplish this is with caching. It’s the same concept of when you cache a web page so your server doesn’t have to access the database every time someone goes to your site. It only reloads the data when something changes. Also remember that Ajax is limited to two connection per URL. There is speculation that IE 8 will allow more but not all users will be using that browser so if you want to make your application for the widest possible audience keep the connections at two.

3. Remember users are click happy. If your application takes a while to load put more then just a spinning circle. Many users will think that the page is stuck and start reloading the page. Depending on how you have written your application this may lose any data that the user has previously entered in and they may have to star over. A status bar or something like that will let your user know that the application isn’t stuck. Users like to see something that shows your application is doing something. The spinning circle that has become standard seems to have a new definition with users. It seems to mean there is something wrong with the page and it isn’t loading.

4. Just because it can be written in Ajax does not mean it should be written in Ajax. Yes I know Ajax is very robust but it can cause a lot of bandwidth issues. If a script can be written in PHP or Perl, try using that instead to ease the load on your server. Your IT guys will thank you.

Leave a comment