php - Jquery $.post doesnt post data -


i try post data jquery php file this:

$("#i-like-it").click(function() {     $.post(         "stuff.php", {             index_id: 313,             hello: "my friend"         }     ); }); 

that's stuff.php got in $_post:

array(0) { } 

php file:

<?php  echo var_dump($_post);  ?> 

what hell doing wrong? spent 2 hours , testing code brain overheated right now. im done.

$("#i-like-it").click(function() {     $.ajax({         url: "stuff.php",         type: "post",         data: { index_id: 313,                 hello: "my friend"         }     }).done(function(response){       // handle response     }); }); 

check out jquery documentation: http://api.jquery.com/jquery.ajax/


Comments