-
Checking availability of user name with AJAX

Lately I’ve been writing quite much about AJAX, but it is so useful that I’m sure it is of everyone’s interest!
In this post I will show you – as the post title says – an example script of AJAXed registration form, without recurring to AJAX frameworks (there are already many tutorials about this topic in relation with them). The example omits the synchronous part of the registration and focuses on the user name, which we want to asynchronously check. It doesn’t sound so weird if I say it in other words: check on the fly if the user name the person is typing already exists in the database or not, and take actions depending on whether it does or not (for instance, only allow form submission if name is available).
This is the basis for other types of effects like for instance searching contents and dynamically returning result suggestions, or checking if a specific word exists in the database, etc. but as I mentioned, here the intention is to use it on a registration form.
-
Submit forms with POST method using AJAX
AJAX (Asynchronous JavaScript And XML) is a keystone of Web 2.0 and is very useful in many aspects, because it offers the possibility to change the structure of the page (DOM). For instance, it makes possible sending a form in a website without having to reload the whole page (’asynchronously‘ is the magic word here). The data submitted is processed and may be saved in a database just like classic forms do, but the user can continue browsing during the process.AJAX forms are a must-have for any AJAXed website. They can be used for many, many purposes: for checking whether a username already exists in the database; for seamlessly sending registrations, feedback or comments; or even for creating a shoutbox or chat script.
Read the rest of this entry » -
Refreshing DIV content with AJAX (multiple DIVs)
After reading the post Refreshing DIV content with AJAX, you already know how to refresh the content of a DIV in your website with the help of AJAX. But perhaps you want to refresh more than one DIV, and you’ve realised the code in the other post didn’t work! Don’t panic, as a matter of a fact refreshing multiple DIVs is the same process than refreshing a single DIV. I’ve prepared an example and some code so you can see how easy it is. See the working demo here. -
Automatically query MySQL and output results with AJAX
This is an extension of the post Refreshing DIV content with AJAX. I recommend you read it at first because you will understand better what the script below is about.What this script does is the following: without having to press any refresh button, and not even reloading the whole page (but a DIV), it retrieves every X seconds the specified data from a MySQL database and displays in the DIV the refreshed contents of it. In other words, it queries the database regularly and updates the output. Read the rest of this entry »
-
Refreshing DIV content with AJAX
AJAX (Asynchronous JavaScript And XML) is a keystone of Web 2.0 and is very useful in many aspects, because it offers the possibility to change the structure of the page (DOM). For instance, it makes possible refreshing a part of a website instead of having to use the classic page reload, which requests again the whole page from the server even when the updated parts are minimal (much slower and of course consumes more bandwidth; therefore making the visitor experience worse).If you know what a HTML <div> tag is and how to use it, with the help of AJAX refreshing a section of your website is possible. The section which will be refreshed is within a DIV; the rest of the HTML outside the DIV will not be refreshed.
To show you how to do so, I prepared an example with the code required for this purpose. But if you’re new to AJAX and would like to know how the code works, I recommend you to take a look at first at w3schools AJAX tutorial.


