ajax请求成功,但是访问不到部分数据

ajax请求后台数据,console了msg之后,出现的数据,显示是有maxPage的,但是代码中,会报错maxPage为空,这是什么问题?
下面是我的代码

$.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("#loadings").show();
        },
        success : function(msg) {
            $(window.parent.document).find("#loadings").hide();
            $('#tabid 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);
        }

    });

图片描述

阅读 2.3k
2 个回答

read property 'maxPage' of null的意思是xxx.maxPagexxxnull

你看看你报错位置,对maxPage的使用是否正确。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题