あなたは
$('.select_item_category').click(function(){
var category_id = $(this).attr("category-id");
$.ajax({
url: window.location.href,
data: {
category_id : category_id
},
type: "GET",
/* Here is response you receive from server */
success: function(response){
$('#some_output_div').html(response);
/* See contents received */
alert(response);
}
})
});
とサーバー側
上を次のようにあなたは何ができるのか、結果を期待している方法があるのPHPを使用することはできませんので、Ajaxはクライアント側であることに注意してください
<?php
if(isset($_GET['category_id']))
{
/* This is what you sent via ajax */
$category_value = $_GET['category_id'];
/* do your stuffs query whatever */
$some_response = 'This is what you send to browser';
echo $some_response;
die();
}
?>
あなたの投稿を誹謗中傷しないでください。質問を投稿すると、それは(CC-by-SAライセンスのもとで)大規模なスタックオーバーフローコミュニティに属します。この投稿とアカウントとの関連付けを解除する場合は、[解約リクエストの適切なルートは何ですか](http://meta.stackoverflow.com/q/323395/584192)を参照してください。 –