I never had such a problem and I’m pretty puzzled:
function delete_post(id) { var answer = confirm('Are you sure you want to delete your post? (this action cannot be undone)') if (answer) { $.ajax({ method:'post', url: 'ajax/delete.php', data:'id='+id, beforeSend: function(){ $('#delete_post').show('slow'); }, success: function(html) { $('#delete_post').html(html); } }); } else {} return false; }
I had a problem on the server side and, after analizing the output with firebug I noticed that the request turns out to be a GET instead of a post! What Am I missing here?
Oh easy one. The property is type not method:
Note: from the documentation the method (type) is in uppercase (‘GET’, ‘POST’). I don’t actually know if it matters or not however.