<script type="text/javascript">
function update_rating(id)
{
alert(id)
}
</script>
<button class="btn btn-primary" onclick="update_rating({{ comment.id }})">Try it</button>
$.ajax({
url: '/path/to/file',
type: 'default GET (Other values: POST)',
dataType: 'default: Intelligent Guess (Other values: xml, json, script, or html)',
data: {param1: 'value1'},
});