码迷,mamicode.com
首页 > 编程语言 > 详细

后台查出来的数组显示在页面

时间:2021-03-31 12:12:55      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:alt   pre   group   att   http   mem   mod   fun   red   

HTML页面:

   <div class=" row t1" style="text-align:center;">
            <div class="form-group col-xs-2  col-md-offset-1">
                <div class="panel panel-danger" style="background-color:whitesmoke">
                    <div class="panel-heading" style="background-color:orangered;color:white">
                        <h3 class="panel-title">需扫描数</h3>
                    </div>
                    <div class="panel-body tt" style="color:orangered;font-size:15px;font-weight:bold;" data-key="Scaned">
                        0
                    </div>
                </div>
            </div>
            <div class="form-group col-xs-2  col-md-offset-2">
                <div class="panel panel-success" style="background-color:whitesmoke">
                    <div class="panel-heading" style="background-color:green;color:white">
                        <h3 class="panel-title">已扫描数</h3>
                    </div>
                    <div class="panel-body" style="color:green;font-size:15px;font-weight:bold;" id="tt" data-key="BeScaned">
                        0
                    </div>
                </div>
            </div>
            <div class="form-group col-xs-2 col-md-offset-2">
                <div class="panel panel-default" style="background-color:whitesmoke">
                    <div class="panel-heading" style="background-color:grey;color:white">
                        <h3 class="panel-title">待扫描数</h3>
                    </div>
                    <div class="panel-body" style="font-size:15px;font-weight:bold;" data-key="WaitScaned">
                        0
                    </div>
                </div>
            </div>
        </div>

JavaScript:

$.get(_reqUrl.getData, { MemberName: $.trim(MemberName) }, function (result) {                 
                    var model = result.Custom;                              
                    var t1 = model.t1[0]; //t1 = {Scaned: 2, BeScaned: 0, WaitScaned: 2};            
                    $.each($(‘.t1‘).find(‘div[data-key]‘), function (i, m) {
                        $(m).html(t1[$(m).attr(‘data-key‘)]);
                    });
                });

效果图:

技术图片

 

后台查出来的数组显示在页面

标签:alt   pre   group   att   http   mem   mod   fun   red   

原文地址:https://www.cnblogs.com/nanxixi/p/14597510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!