可以使用ajax技术传递参数,比如:
function ShowResult()
{
sqlstr=document.getElementById("txtbook").value;
selstr=document.getElementById("opt").value;
dt="sql=" + sqlstr + "& sel=" + selstr;
//window.alert(dt);
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtres").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","listBook.php",true);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.send(dt);
return;
}