

<input  id="input-7-sm" class="rating-loading"   data-min="0" data-max="5" data-step="0.5" data-size="sm"><hr/>


<script>
    jQuery(document).on('ready', function(){
        jQuery('#input-7-sm').rating({clearCaption: 'No stars yet'});
    });
    jQuery('#input-7-sm').on('rating:change', function(event, value, caption) {
        console.log(value);
        console.log(caption);
        var rating=value;
        var pageid={{postid}};
        console.log(pageid);
        jQuery.ajax({
            type: 'POST',
            async: false,
            url: "{{adminurl}}",
            data: { "action" : "page_view_rating_save", "pageid": pageid, "rating": rating},
            success: function (data) {
                console.log("finisch rating",data);
            },
            error: function (errorThrown) {
                console.log("error rating");
            }
        });
    });
</script>


