XMLHttpRequest对象send方法服务器端取不到的问题
function send_Request()
{
var http_request = new ActiveXObject( "Microsoft.XMLHTTP ");
http_request.open( "POST ", "/AJAXExample/process.jsp ",true);
http_request.send( "num1=10&num2=23 ");
}
这段代码发到服务器端,没能用request.getParameter( "num1 ");方法取到num1,num2参数值,请各位高手赐教
------解决方案--------------------上面的问题解决了没?
我想说一下就是如果你是POST提交的话最好要设置一下
XMLHttpRequest对象的请求头
var http_request = new ActiveXObject( "Microsoft.XMLHTTP ");
http_request.open( "POST ", "/AJAXExample/process.jsp ",true);
http_request.setRequestHeader( "Content-Type ', 'application/x-www-form-urlencoded ');
http_request.send( "num1=10&num2=23 ");
这样我想就应该可以得到了