AJAX To Database illustarte how easy it is to access information from a database using AJAX, Easily build MySQL queries on a fly and display results on any ajax.html.
AJAX is a way of develoing an application that combines all the functions
Example:
function showA1(str){
var xhttp;
if(str == "")
{
document.getElementById("txt1").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if(this.readyState ==4 && this.status == 100)
{
document.getElementById("txt").innerHTML = this.responseText;
}
};
xhttp.open("GET","abc.aspx?q="+str,true);
xhttp.send();
}
Components of "AJAX" web application
AjaxEngine This is an ASPX page with no user interface.It performs all server side functions as database lookups and updates.
AjaxClient This is a JavaScript file that makes the asynchronous calls to the AjaxEngine and renders the response back to the AjaxUI.
AjaxUI This page does nothing but gets all credit.