JS 数组相关

数组

function SelectLoadTable() {
    var mids = $("#mids").val();
    var halls = $("#halls").val();
    var date = $("#date").val();
    var timeInterval = $("#timeInterval").val();
    var sessions = $("#sessions").val();
    $.ajax({
        type: "post",
        url: "/Statis/ScoreStatisSelect",
        data: { mids: mids, halls: halls, sessions: sessions, date: date, timeInterval: timeInterval },
        success: function (obj) {
            console.log(obj);
            if (obj.code == "200") {
                var xs1 = [];
                var ys1 = [];
                for (var item in obj.result) {
                    xs1.push(item);
                    ys1.push(parseFloat(obj.result[item]).toFixed(1));
                }
                drawbarFunc(xs1, ys1);
            }
            else {
                layer.msg(obj.message, { icon: 7, time: 1800 });
            }
        },
        error: function () { layer.msg('发生错误,请联系客服!', { icon: 2, time: 1800 }); }
    });
}

 

posted @ 2019-07-24 15:27  一只桔子2233  阅读(119)  评论(0编辑  收藏  举报