I describe my problem with following simple example.
function show(str)
{
if (window.XMLHttpRequest){
xmlhttp=new XMLHttpRequest();
}
else
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","data.php?q="+str,true);
xmlhttp.send();
}
here,i am getting some responsetext or result from data.php file through my request.
In my responsetext, i've used some input fields, buttons. How can i add functionality to that fields, which are fetching from external file(eg: data.php) through ajax request.
Can anyone plz help me?