Adding post to current query

i have the following


<script type="text/javascript">
	$(document).ready(function() {
    $("button").click(function(event) {
        alert(event.target.id);
});
});
	  </script>

This tells me the id of the button that has been pressed.

how would i add a $post request to index.php?id= with the value of the id?

got


	 <script type="text/javascript">
$(function(){
  $("button").on("click", function(){
    var myId = $(this).attr("id");
	$.post( "index.php?id="+myId);
  });
});
	  </script>

but i need a way to capture this as $_POST[‘’]; is not

fixed but $_POST & $_GET are empty for some silly reason


	 <script type="text/javascript">
$(function(){
  $("button").on("click", function(){
    var myId = $(this).attr("id");
	$.post( "index.php?id="myId, {id:myId} );  
  });
});
	  </script>