<script type="text/javascript">
$(document).ready(function(){
$(".Categories").click(function(){
var catId=$(this).attr('id');
catId=String(catId);
jQuery.ajax({
url:"index.php",
data:{catId},
type:"POST",
success: function(data){
$("#categoryField").html(data);
}
});
});
});
</script>
I need to pass my clicked button id to the same index.php page, without page refreshing and work with that id value.My code is wrong, because page is rendered second time.
