You are currently browsing the tag archive for the 'rating system' tag.

Have yet to try this out on any of my websites but think it would be very neat to include on any real estate or e commerce website.

——————————–

AJAX Rating Stars Demo

Examples

Simple form binding

var s1 = new Stars({ maxRating: 5, bindField: ‘myRating’, imagePath: ‘images/’, value: 4.5 });

<script type="text/javascript">
  var s1 = new Stars({
    maxRating: 5,
    bindField: 'myRating',
    imagePath: 'images/',
    value: 4.5
  });
</script>

JavaScript callback function

function rating(val) { alert(‘You rated it ‘ + val + ‘ star(s)!’); } var s2 = new Stars({ maxRating: 5, imagePath: ‘images/’, callback: rating });
<script type="text/javascript">
  function rating(val)
  {
    alert('You rated it ' + val + ' star(s)!');
  }
  var s2 = new Stars({
    maxRating: 5,
    imagePath: 'images/',
    callback: rating
  });
</script>

Sending values through AJAX

function ajaxRating(xml) { var x = xml.responseXML; var xmlRating = x.getElementsByTagName(‘rating’); var rating = xmlRating[0].firstChild.nodeValue; alert(‘You rated it ‘ + rating + ‘ star(s)!’); } var s3 = new Stars({ maxRating: 5, actionURL: ‘rate.php?rating=’, callback: ajaxRating, imagePath: ‘images/’, value: 3 });
<script type="text/javascript">
  function ajaxRating(xml)
  {
    var x = xml.responseXML;
    var xmlRating = x.getElementsByTagName('rating');
    var rating = xmlRating[0].firstChild.nodeValue;
    alert('You rated it ' + rating + ' star(s)!');
  }
  var s3 = new Stars({
    maxRating: 5,
    actionURL: 'rate.php?rating=',
    callback: ajaxRating,
    imagePath: 'images/',
    value: 3
  });
</script>

Read more at: http://www.beauscott.com/examples/RatingStars/

Pages

 

November 2009
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

RSS Example RSS Real Estate Feed

  • An error has occurred; the feed is probably down. Try again later.