I am sending an ajax request to a php file as shown here:
function checkDB(code, userid)
{
$.ajax({
type: \"POST\",
url: \"
Try this code... it is working for me ...
<script type='text/javascript'>
$(document).ready(function(){
$(".star").click(function(){
var rate_value1= $(this).index(".star")+1;
$.ajax({
type: "POST",
dataType: "json",
url: "<?php echo(rootpath()) ?>/vote.php",
data: { product_id: '<?php echo($product_id_to_permalink) ?>' , rate_value: rate_value1 }
});
});
});
</script>