Cant get my head around ajax post....

Cant get my head around ajax post....

I really cant get to grips how $.post works =( Im hoping someone can please give me a quick point in the right direction.


This is my button and its function....

  1. $('#delete').click(function() { 
  2.     $.post("delete.php", { delID: $(this).attr("delid")});
  3. });
  4. <button id="delete" type="button" delid="2">Delete</button>
I just want it to go to delete.php and set $delID = $_POST['delID'] so then I can go onto mysql delete where id = $delID....

All I have in my delete.php at the moment just for testing is 
  1. echo $_POST['delID'];
Its very hard to find a simple demonstration that does just that.

Please please please help me. Im a dumny =P