Here is the simplest version of the Ajax Engine which can be use without any "DLL" or "Class" or "Frame work" . All you need is a server side technology such as ASP,PHP,JSP etc.
function fetchData(url,objectID)
{
var pageRequest = false;
if (window.XMLHttpRequest)pageRequest = new XMLHttpRequest();
else if (window.ActiveXObject) pageRequest = new ActiveXObject('MSXML2.XMLHTTP.3.0');
else return false;
pageRequest.onreadystatechange = function() {
try
{
if (pageRequest.readyState > 3)
{
var object = document.getElementById(objectID);
object.innerHTML = pageRequest.responseText;
}
}
catch(err)
{}
}
pageRequest.open('get',url,true);
pageRequest.send(null);
}
working method
Make an HTML container such as div,span,p,b or table. Give 'id' attribute with some name say 'div id="dynamicdiv" '. Now you can write a server side page with some content.
From the first page you can call this function with parameters, where first parameter is the URL of the server side page u created and second parameter is the id of the HTML container you created.... this will retrieve the output of the server side page and display it in the HTML container you created.
The script is compatible with IE 5.5+ and Firefox so that there is no browser issues.
Also i have tweaked the script to use a minimum number of HTTP requests.
Have fun enjoy the Ajax technology, start using it.
Regards
Clain D'silva