I was reading by stackoverflow in English the way to receive in jQuery the value of a PHP variable and I found this way:
$(document).ready(function(){
$(".topic").click(function () {
var postId = "<?php echo $post[\'id\']; ?>";
alert(postId);
});
});
And at the moment of executing the script, in the alert I see the PHP code literal instead of executing the echo and showing the value. How can i fix this? Thanks.