• JSONView


    <div class="modal fade bs-example-modal-lg" id="jsonModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
          <div class="modal-dialog" role="document" style="">
               
                <div class="modal-content col-md-12" style="1000px !important;margin:50%;transform:translate(-50%,-50%);">
                      <div class="modal-header" style="padding-left:0;padding-right:0;">
                           <button type="button" class="close" data-dismiss="modal" aria-label="Close" style=""><span aria-hidden="true">&times;</span></button>
                           <h4 class="modal-title notice_title" id="myModalLabel" style="font-family:'微软雅黑';font-size:16px;color:#383838;">JSON查看</h4>
                            
                      </div>
                      <div class="modal-body col-md-12" style="padding-left:0;padding-right:0;max-height:800px;overflow-y:scroll;"> 
                            <div style="margin:10px;">
                                  <button id="collapse-btn">收起</button>
                              <button id="expand-btn">展开</button>
                              
                            </div>
                               <div id="jsonContent"></div>
                      </div>
                      
                </div>
             
          </div>
                       
    </div>
    $('#operationTable').on('click', 'span.contentHistory', function (e) {
    
    $('#jsonModal').modal({backdrop: 'static'});
    var datalist=$(this).data('content');
    
    datalist=JSON.parse(datalist);
    
    //    var json = {"hey": "guy","anumber": 243,"anobject": {"whoa": "nuts","anarray": [1,2,"thr<h1>ee"],"anotherarray": [1, 2], "more":"stuff"},"awesome": true,"bogus": false,"meaning": null, "japanese":"明日がある。", "link": "http://jsonview.com", "notLink": "http://jsonview.com is great"};
    $('#jsonContent').JSONView(datalist);
    e.stopPropagation();
    $(this).unbind("click"); //移除click
    return false;
    });
    
    $('#collapse-btn').on('click', function() {
    $('#jsonContent').JSONView('collapse');
    });
    
    $('#expand-btn').on('click', function() {
    $('#jsonContent').JSONView('expand');
    });
    
    $('#toggle-btn').on('click', function() {
    $('#jsonContent').JSONView('toggle');
    });
    
    $('#toggle-level1-btn').on('click', function() {
    $('#jsonContent').JSONView('toggle', 1);
    });
    
    $('#toggle-level2-btn').on('click', function() {
    $('#jsonContent').JSONView('toggle', 2);
    });
  • 相关阅读:
    计算机网络 3.* 数据通信技术基础 .1
    计算机网络3.2&3.3(第二节介质&第三节多路复用)
    python mooc 3维可视化<第一周第二&三单元>
    python mooc 3维可视化<第一周第一单元>
    conda 下配置环境
    第二周<岭回归>
    第二周<线性回归>
    第二周<导学/分类>
    iOS UILabel详解
    开始iOS 7中自动布局教程(一)
  • 原文地址:https://www.cnblogs.com/zjpzjp/p/7575575.html
Copyright © 2020-2023  润新知