October 18th, 2006, 03:56 PM
Hi guys. I'm just getting started with ajax to use with PHP.
i'm reading a book that begins with some examples of where ajax can be used. One of these examples was when you select a country in a form, ajax dynamically returns the areas of that country in the next box. This could obviously be done in javacript alone so what is the difference and benefits of using ajax for this particular example and similar situations??
October 18th, 2006, 04:20 PM
Fetching only the necessary content?
fwiw, I think ajax is overused, i've seen entire sites written in ajax and that's ridiculous, you lose the ability to link to a specific page and you completely cut out older browsers that don't do ajax.
Use ajax where it is the best solution to a problem and nowhere else.
October 18th, 2006, 04:22 PM
Comments on this post
October 18th, 2006, 04:41 PM
Hi guys thanks for your replies
Linux Penguin - yea that's pretty much what I thought. I wouldn't consider doing whole sites with ajax. I'm just looking at for improving a few UI features
October 18th, 2006, 04:48 PM
Originally Posted by lsals
October 18th, 2006, 08:40 PM
As LP said, it's great for making sites a bit more responsive. Common examples include filling in drop down sub menus based on the users choice. For example, "please select which country you live in" -> "and the city". The non ajax-y way would be to either load all possible citys for all countries (large and slow), and swap between them with something like an onSelect. Using ajax you can wait for the user to select the country, and bounce back to the server to get the city list, and then swap it in. Should send less data to the user, and be a bit more responsive.
October 19th, 2006, 05:01 AM
Hi guys. thanks alot for your responses. I think I get what Ajax is all about now.