title: Delete row from Table with ajax
body: <p>I found this code on the internet and i need the ajax code to POST the <code>$row[ID]</code> to my <code>delete.php</code> file:</p>
  
  <pre><code>echo "&lt;td&gt;&lt;a id=$row[ID]  onclick=\"if(confirm('Are you sure you want to delete this?')) deleteRow(this.parentNode.parentNode.rowIndex); return false; \" href=\"\"  &gt;del&lt;/A&gt; &lt;/td&gt;"
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>function deleteRow(i){
      var makarios = document.getElementById('m').deleteRow(i)
      var mak;
  
      if (window.XMLHttpRequest) {
          // Mozilla, Safari, ... 
          mak = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
          // IE 8 and older
          mak = new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      var data = "id=" + makarios;
      mak.open("POST", "delete_basket.php", true);
      mak.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
      mak.send(data);
  }
  </code></pre>