您只需要包括以下脚本。
<script language="javascript" type="text/javascript"> var xmlHttp function showState(str) { //if you want any text box value you can get it like below line. //just make sure you have specified its "id" attribute var name=document.getElementById("id_attr").value; if (typeof XMLHttpRequest != "undefined") { xmlHttp= new XMLHttpRequest(); } var url="forwardPage.jsp"; url +="?count1=" +str+"&count2="+name"; xmlHttp.onreadystatechange = stateChange; xmlHttp.open("GET", url, true); xmlHttp.send(null); } function stateChange() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("div_id").innerHTML=xmlHttp.responseText }} </script>因此,如果您得到了代码,让我告诉您,div_id将是div标签的ID,您必须在其中显示结果。通过使用此代码,您正在将参数传递到另一个页面。无论执行什么处理,都将反映在id为“
div_id”的div标签中。您可以在任何控件的“ onChange”事件或未提交按钮的“
onClick”事件上调用showState(this.value)。进一步的查询将不胜感激。



