Networking, Programming and Graphics Tutorials

AJAX Search Tutorial [1/3]

Type: Code Networking, Programming and Graphics Tutorials
AJAX Search Tutorial
Level: Beginner Networking, Programming and Graphics Tutorials 
AJAX Search Tutorial
Date: 2008-Jul-22
AJAX Search Tutorial
Visited: 599 times
AJAX Search Tutorial
Rating: AJAX Search Tutorial
AJAX Search Tutorial
Author: Ivory Morhuld

To see how AJAX works, we will develop small AJAX Web Application.

First of all we need some HTML file with forms to input data. This will be one input field where we can write some text. In our case this will be some name. This HTML file we will save under ajax.html name. The code of HTML file can taken from box bellow: (Please note that the text input handle onkeypress event and call to ajax(); function and there is no "Submit" button in HTML form)

<html>
<body>
<input type="text" onkeyup="ajax(this.value);">
</br>
<div id="result"></div>
</body>
</html>
The key of each AJAX application is the XMLHttpRequest object. In some browsers we have to use one methods to create the XMLHttpRequest object. In other browser we have to use other method. Because we don't know what browser use the user we will try each method until we successfully make XMLHttpRequest object.

var xmlhttp;
try {
    xmlhttp=new XMLHttpRequest();
}
catch (e) {
    try {
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
         catch (e) {
        try {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (e) {
            alert("Your browser does not support AJAX!");
            return false;
        }
    }
}
Networking, Programming and Graphics Tutorials - AJAX Search Tutorial [1/3] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: ajax php mysql search tutorial  Mysql ajax box search tutorial  ajax search example  php ajax mysql search  ajax mysql search  ajax tutorial, ajax reference  vim search in text  how to be number one on google search  Sequential search c++ tuto  mysql search with php exact phrase  php mysql search exact phrase  php mysql search query script  "php script" search mysql query  php mysql search sponsor link  mysql search "Exact phrase"  php mysql search Select * database where  ajax tutorial  ajax with php tutorial  ajax +tutorial  php ajax tutorial