There is also an option to display small or big stars and images can be changed with any other file easily.
Although jRating can be used with any scripting language, a PHP file that handles the requests is already included in the download package on github
IMPLEMENTATION:
1. FIRST, INCLUDE THE CSS & JQUERY FILES
<!-- include CSS & JS files -->
<!-- CSS file -->
<link rel="stylesheet" type="text/css" href="jRating.jquery.css" media="screen" />
<!-- jQuery files -->
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jRating.jquery.js"></script>
2. ADD YOUR HTML
<!-- basic exemple -->
<div class="exemple">
<!-- in this exemple, 12 is the average and 1 is the id of the line to update in DB -->
<div class="basic" id="12_1"></div>
<!-- in this other exemple, 8 is the average and 2 is the id of the line to update in DB -->
<div class="basic" id="8_2"></div>
</div>
3. NOW, CALL THE JRATING PLUGIN
<script type="text/javascript">
$(document).ready(function(){
// simple jRating call
$(".basic").jRating();
// more complex jRating call
$(".basic").jRating({
step:true,
length : 20, // nb of stars
onSuccess : function(){
alert('Success : your rate has been saved :)');
}
});
});
</script>
METHODS:
onSuccessFunctionReturns :
null - Callback function in case of success during rating.
onErrorFunctionReturns :
null - Callback function in case of failure during rating.
SCREENSHOTS
http://www.myjqueryplugins.com/jquery-plugin/jrating#field_methods