Using the jQuery Star Rating plugin, everything worked well until I selected a star rating from the rating callback handler. A simple example:
$('.rating').rating({
...
callback: function(value){
$.ajax({
type: "POST",
url: ...
data: {rating: value},
success: function(data){
$('.rating').rating('select', 1);
}
});
}
});
I assume that this infinite loop occurs because the callback starts after manual selection. When a user submits their rating, I would like to “choose” the average rating for all users (this is the value in the data returned to the success handler).
How can I do this without starting an infinite loop?
source
share