用ajax的post向servlet提交一个数据,无获得值..求助~在线等待....
用ajax的post向servlet提交一个数据代码为:varturn_page=document.getElementById("next").value;varoHt...
用ajax的post向servlet提交一个数据
代码为:
var turn_page=document.getElementById("next").value;
var oHttp=createXmlHttpRequest();
oHttp.open("POST","../CallbedView",true);
oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
oHttp.onreadystatechange=showMsg1;
oHttp.send("turn_page="+turn_page);
document.getElementById("form1").submit();
按如歌说的..代码改为了
var turn_page=document.getElementById("next").value;
var oHttp=createXmlHttpRequest();
oHttp.open("POST","../CallbedView",true);
oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
oHttp.send("turn_page="+turn_page);
而另外servlet里的代码是
String turn_page=(String)request.getParameter("turn_page");
可是结果还是空值...而且好像没有进入servlet 展开
代码为:
var turn_page=document.getElementById("next").value;
var oHttp=createXmlHttpRequest();
oHttp.open("POST","../CallbedView",true);
oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
oHttp.onreadystatechange=showMsg1;
oHttp.send("turn_page="+turn_page);
document.getElementById("form1").submit();
按如歌说的..代码改为了
var turn_page=document.getElementById("next").value;
var oHttp=createXmlHttpRequest();
oHttp.open("POST","../CallbedView",true);
oHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
oHttp.send("turn_page="+turn_page);
而另外servlet里的代码是
String turn_page=(String)request.getParameter("turn_page");
可是结果还是空值...而且好像没有进入servlet 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询