This time I will share jQuery Plugin and tutorial about Display Reviews And Ratings Of A Place With jQuery And Google Maps, hope it will help you in programming stack.
Google Reviews is a small and easy jQuery plugin which embeds Google reviews and ratings of a matched place into the webpage using Google Places API.
How to use it:
1. Load the necessary jQuery library and Google Places API in the document. DO NOT FORGET TO SET YOUR OWN API KEY! You can create an API key here.
1 |
< script src = "/path/to/cdn/jquery.min.js" ></ script > |
2. Load the jQuery google-reviews plugin’s files in the document.
1 |
< script src = "jquery-google-reviews.js" defer></ script > |
2 |
< link href = "jquery-google-reviews.css" rel = "stylesheet" > |
3. The plugin needs an id to interact with, best with an empty div.
1 |
< div id = "google-reviews" ></ div > |
4. Call the function on the DIV element and insert the placeId into the JavaScript as follow. You can find a placeID here.
1 |
$("#google-reviews").googlePlaces({ |
2 |
placeId: 'ChIJZa6ezJa8j4AR1p1nTSaRtuQ' |
5. All configuration options to customize the Google reviews and ratings.
01 |
$( "#google-reviews" ).googlePlaces({ |
04 |
placeId: 'ChIJZa6ezJa8j4AR1p1nTSaRtuQ' , |
07 |
header: "<h3>Google Reviews</h3>" , |
19 |
months: [ "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" ], |
22 |
text_break_length: "90" , |
28 |
moreReviewsButtonUrl: '' , |
31 |
moreReviewsButtonLabel: 'Show More Reviews' , |
34 |
writeReviewButtonUrl: '' , |
37 |
writeReviewButtonLabel: 'Write New Review' , |
40 |
showReviewDate: false , |
43 |
showProfilePicture: true |
Changelog:
v1.3.2 (2020-10-11)
- fix: apply prettier rules
v1.3.1 (2020-05-29)
202-01-29
2019-12-06
- v1.3.0: added option to show profile picture
2019-07-13
2019-07-10
2019-07-07
- renders empty if no reviews found
2019-04-04
2019-04-01
- Update with “show more reviews” and “write a review” feature