ajax requests background data. After console the msg, the data that appears shows that there is maxPage, but in the code, it will error that the maxPage is empty. What is the problem?
here is my code
$.ajax({
url : "../../yqParameter/queryForList",
// url : "../../json/test_smokeQuality_paramsync.json",// json
data : {
limit : rowNum,//
thisPage : pageNo,//
runningStatus : runstateo,//
msgStatus : msgstateo,//
lackStatus : qualitystateo,
dtuImei : dtustateo,// DTU
dvArea : valArea,//
dvName : mouSearch
//
},
type : "post",
dataType : "jsonp",
// dataType : "json",
beforeSend : function() {
$(window.parent.document).find("-sharploadings").show();
},
success : function(msg) {
$(window.parent.document).find("-sharploadings").hide();
$("-sharptabid tbody").empty();
// console.log(msg);
console.log(msg.data.maxPage);
totalPage = msg.data.maxPage;
totalRecord = msg.data.total;
// console.log(totalRecord);
kkpager.total = totalPage;
kkpager.totalRecords = totalRecord;
initpage(pageNo, totalRecord, totalPage);
// table
successmsg(msg);
$(".loadings").hide();
},
error : function(jqXHR, textStatus, errorThrown) {
autoLogin(jqXHR);
}
});