Friday, 15 July 2011

AJAX-Passing the multiple value to another page.

function searchDoc1(str,str1)
{

if (str=="")
{
document.getElementById("list").innerHTML="";
return;
}
if (str1=="")
{
document.getElementById("list").innerHTML="";
return;
}

if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
//alert(xmlhttp.responseText);
document.getElementById("list").innerHTML=xmlhttp.responseText;
}
else if(xmlhttp.readyState==3)//waiting Module
{
document.getElementById("list").innerHTML = "waiting";// or "using the image tag to display image"
}
}
var url1="list_out.php"

url=url1+"?q1="+str+"&q2="+str1

xmlhttp.open("GET",url,true);
xmlhttp.send();
}

No comments:

Post a Comment