Passing php file in ajax <p>This is my code</p> <pre><code>&lt;script&gt; $(document).ready(function() { // delete the entry once we have confirmed that it should be deleted $('.delete').click(function() { var parent = $(this).closest('tr'); $.ajax({ type: 'POST', url: 'delete.php', data: 'ajax=1&amp;delete=' + $(this).attr('id'), success: function() { parent.fadeOut(300,function() { parent.remove(); }); } }); }); $('.delete').confirm({ }); }); &lt;/script&gt; </code></pre> <p>My question is why delete.php is not executing? It's in the same folder, do I need type absolure url to this file? But the best of it is that row in table is deleting, but php file is not executing. And second question is why this code is not working without this line:</p> <pre><code> $('.delete').confirm({ }); </code></pre> <p>In php file i got this to know is it executed:</p> <pre><code>&lt;script&gt; alert('aaaa'); &lt;/script&gt; </code></pre> <p>Or even I had change it on <code>echo 'something';</code> but still not working</p>