图1 修改参数pagesize 就能调整一个页面展示的数量多少
我自己写代码修改pagesize参数就只能获得第一页的内容,大神门帮忙解决下!
而且请求的参数是发送正常的
var xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTp");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function createQueryString() {
var fromDate = document.getElementsByName('fromDate')[0].value;//获取开始日期
var toDate = document.getElementsByName('toDate')[0].value; //获取结束日期
var pageSize =30;
var curPage =1;
var data = "orderDateStart="+fromDate+"&orderDateEnd="+toDate+"&curPage="+curPage+"&pageSize="+pageSize;
return data;
}
function doRequestUsingPOST() {
createXMLHttpRequest();
var url = "http://qta.com:9000/confirm/api/allorder/queryOrder";
var queryString = createQueryString();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-rulencoded;");
xmlHttp.send(queryString);
}
function handleStateChange() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
pareseResults();
}
}
}
function pareseResults() {
var jsonObj = eval('('+xmlHttp.responseText+')'); //转化为json对象
}