JQuery traverses the information to the instance code on the interface

Time:2020-2-11

Nonsense without code PS: can you understand all things


<script>
  $(document).ready(function () {
    $('#btn').keydown(function () {
      $.ajax({
        url:'admin/car/query',
        type:'get',
        dataType:'json',
        success:function(data){
          var td = "";
          for(var i=0;i<data.length;i++){

            var ls=data[i];

            td="<td>"+ls.user_id+"</td>"+"<td>"+ls.car_num+"</td>"+"<td>"+ls.reason+"</td>"+"<td>"+ls.remark+"</td>"
              +"<td>"+ls.driver+"</td>"+"<td>"+ls.driver_verify+"</td>"+"<td>"+ls.office_verify+"</td>"+"<td>"+ls.driver_turn_down+"</td>"
              + "<td>"+ls.office_turn_down+"</td>"+"<td>"+ls.use_time+"<td>"+ls.office_turn_down+"</td>"
            $('#tableSort').append("<tr>"+td+"</tr>");
          }
        }
      })
    })


  })
</script>

The displayed result is as shown in the figure

These are all the related knowledge points in this introduction. Thank you for your learning and support for developepaer.

Recommended Today

Python basics Chinese series tutorial · translation completed

Original: Python basics Python tutorial Protocol: CC by-nc-sa 4.0 Welcome anyone to participate and improve: a person can go very fast, but a group of people can go further. Online reading Apache CN learning resources catalog introduce Seven reasons to learn Python Why Python is great Learn Python introduction Executing Python scripts variable character string […]