Hi,
I saw a script in w3schools. And Below I have written some comments near functions, but still - there I wrote some questions and you will see them in the script...
Please answer most understandlythanks.
Here is the script:
PHP Code:var xmlhttp;
//function ShowUser which generates link (with information) to send to php script.
function showUser(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="getuser.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
//Function StateChanged, is active only when you choose other value in the form, or I AM WRONG????
function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
//And this function is always needed. Maybe to send and get back information?? What does this function? Do I have to use it fully, or I can ommit something?
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
The real script is HERE
Comment this topic as best you can, because I take a deep interest in every word you will say. Really serious in understanding this. THANKS.



thanks.
Reply With Quote

Bookmarks