title: how do i add data from database to data table. i don't know ajax
body: <p>The data I added from the modal is successfully saved in the database. But I can't show it in the table. What's wrong with the code below?
  I'm new to ajax. tabbleadd() is defined as onclick on the button Thanks</p>
  <p>onclick=&quot;Tabloyaekle()</p>
  <p>'''
  function tableadd(data) {</p>
  <pre><code>$.ajax({
      type: &quot;POST&quot;,
      url: '/Haberler/AddNews',
      data: data,
      success: function (data) {
          if (data.success) {
  
              var t = $('#exampleModalSizeLg').DataTable();
              t.row.add(data);
              Swal.fire(
                  'Başarılı',
                  'Eklendi',
                  'success'
              )
          }
          else {
              Swal.fire(
                  'HATA',
                  '!' + data.mesaj,
                  'error'
              )
          }
      },
      error: function () {
          Swal.fire(
              'HATA',
              'Eklenemedi',
              'error'
          )
  
  
      }
  })
  </code></pre>
  <p>}
  '''</p>