jq获取后台json并解析


参考:

    $(function () {
        $.ajax({
            url: 'tsconfig.json',
            type: 'GET',
            dataType: 'json',
            timeout: 1000,
            cache: false,
            beforeSend: LoadFunction, //加载执行方法
            error: erryFunction,  //错误执行方法
            success: succFunction //成功执行方法
        })
        function LoadFunction() {
            $("#meeting-record").html('加载中...');
        }
        function erryFunction() {
            alert("error");
        }
        function succFunction(data) {
            $("#meeting-record").html('');//先清空
            $.each(data.dtos, function (i,item) {//循环获取数据
                $("#meeting-record").append(
    //                    "<div>" + item.calledNumber + "</div>"
                    '<div>'+
                        '<ul class="meeting">'+
                            '<li>'+
                                '<div class="three-icon">'+
                                    '<span class="small-icon">立娟</span>'+
                                    '<span class="small-icon" style="float:left;margin-right:6px;">小强</span>'+
                                    '<span class="small-icon" style="float:left;">灿烂</span>'+
                                '</div>'+
                                '<div class="right-cont">'+
                                    '<p>'+
                                        '<span class="content">每周例会劳动纠纷的立法局的俄反饥饿反饥饿哦分</span>'+
                                        '<span class="time">今天</span>'+
                                        '<time>16:30</time>'+
                                    '</p>'+
                                '</div>'+
                            '</li>'+
                        '</ul>'+
                    '</div>'
                )
            });
        }
    });

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM