title: how using foreach in ajax codeigniter
body: <p>Dear Expert need help how to add foreach between variable tbaris :</p>
  
  <pre><code>function show_infouser(Kode)
     { save_method = 'update';
         $('#form')[0].reset(); // reset form on modals
         $('.form-group').removeClass('has-error'); // clear error class
         $('.help-block').empty(); // clear error string
         $.ajax({url : "&lt;?php echo site_url('infouser/ajax_user')?&gt;/" + Kode,
         type: "GET",
         dataType: "JSON",
         success: function(data){
           if (data == null)
           { showConfirmButton: false }); }
           else {
  // want to show foreach in here
             var tbaris = '&lt;tr&gt;&lt;td style="width:3px; font-size:11px;"&gt;&lt;center&gt;'+data.No+'&lt;/center&gt;&lt;/td&gt;';
             tbaris += '&lt;td style="width:3px; font-size:11px;"&gt;&lt;center&gt;'+data.Name+'&lt;/center&gt;&lt;/td&gt;';
             tbaris += '&lt;td style="width:3px; font-size:11px;"&gt;&lt;center&gt;'+data.Job+'&lt;/center&gt;&lt;/td&gt;';
             tbaris += '&lt;td style="width:3px; font-size:11px;"&gt;&lt;center&gt;'+data.Status+'&lt;/center&gt;&lt;/td&gt;';
             $('#tableuser tbody').html(tbaris);
             $('#modal_form1').modal('show');
             $('.modal-title').text('SHOW ROOM');}},
            error: function (jqXHR, textStatus, errorThrown)
                 {
                     alert('Error get data from ajax' + errorThrown);
                     alert('Error get data from ajax' + textStatus);
                     alert('Error get data from ajax' + jqXHR);
                 }
             });
         }
  </code></pre>