Coding Demo: AJAX
A small demo using AJAX.
The data may also be returned as a text string. This could be a simple sentence or two, or a fully-formatted HTML structure ready for insertion directly into the page. Each of these formats have their advantages, and which you choose to use will depend on the requirements of the project.
The following example will automatically suggest countries and their 2-digit ISSO code as you type into the entry box. Or, select the “Code” button and it will look the countries up by their 2-digit code. Note how both elements react to your input.
As you can see, this can make your site a lot more responsive and helpful!
Please click on the following links to see each in action.