Ratings and Comments for Good Shepherd Fairview Home
80 Fairview Ave, Binghamton, NY 13904
' + data.aggregateRating.ratingCount + ' Customer Satisfaction Ratings
'
].join('');
// take the above HTML and append it to a DOM element
$("#rating-sum").empty().append(html);
html = '';
buildCrawlerData(data);
},
error: function (data) {
console.log("You've hit the error path");
console.log(data);
// build error message. HTML goes below
var html = [
'Rating Not Available
'
].join('');
// append HTML to DOM to display
$("#rating-sum").empty().append(html);
html = '';
}
});
}
function buildCrawlerData(data) {
// this can be appended anywhere on the page
$('body').append('
loading...
', '
Comments are currently unavailable
'
].join('');
$('#rating-summary').empty().append(html);
$('#rating-distro').empty();
$('#rating-comment-list').empty();
}
});
}
function BuildRatingSummary(commentData) {
$.get("https://ratings.practicemax.com/api/aggregate/" + client + "/" + clientLocation, function (data) {
BuildCommentSummary(data, commentData);
var starVal = (Math.round(data.aggregateRating.ratingValue * 2) / 2).toString().replace(".", "");
var html = [
' ',
'',
'Overall Rating'
].join('');
$('#rating-summary').empty().append(html);
html = [
'',
'',
' ',
' ',
'
'
].join('');
$('#rating-comments').prepend(html);
});
}
function BuildCommentSummary(data, commentData) {
var html = "";
for (var i = 5; i > 0; i--) {
var comPercent = (commentData.scoreDistribution["s" + i] / (commentData.scoreDistribution.s1 + commentData.scoreDistribution.s2 +
commentData.scoreDistribution.s3 + commentData.scoreDistribution.s4 +
commentData.scoreDistribution.s5)) * 100;
html += [
'- ' + commentData.scoreDistribution["s" + i] + ' Ratings ', " ', ' ", '
loading...