create table in ajax, the number of tr depends on the number of positions of an array

0

hello I've never asked for here, but I hope you can help me, ok I'll explain what I want, I'm trying to create a table in ajax to save the results I have in an array, so the number of tr of that table must be the same as the positions of my array, the problem is that when I run it I get this error: Uncaught RangeError: Maximum call stack size exceeded, which I do not understand. Here is my ajax code:

$.ajax({
    url: '<?php echo base_url(); ?>index.php/Manager/metricsAdvocates',
    type:  'post',
    data:  {'sup':sup, 'dateM':dateM},
    dataType: 'json',

     success: function(response){

       array=response;

       var tabla = '<table class="table table-hover table-bordered table-striped" id="tableManag">';
         tabla += '<thead>';
         tabla += '<tr>';
         tabla += '<th>vhur</th><th>Advocate</th><th>Attendance</th>';
         tabla += '</tr>';
         tabla += '</thead>';
         tabla += '<tbody>';
         tr = '';

        for (i=0; i < array.length; i++){
              alert('succest');

             tr += '<tr>';
             tr += '<td id = "vhur"></td><td id="Advocate"></td><td id= "att"></td>';
             tr += '</tr>';
          }

         tabla += tr;
         tabla += '</tbody></table>';

         $('#tableAtt').html( tabla );

       }
     });  

aside I have the method where I give the values to my arrangement but the error comes from the ajax is but not even redirect me to the other method.

Thank you, I hope you can help me.

    
asked by user80520 20.03.2018 в 23:44
source

0 answers