For a new project I'm working on, I will need a mechanism for users to vote on certain pieces of content. Now it turns out that there are a billion and one ways of doing this, with an additional billion sets of frameworks. I was quite overwhelmed by the number of choices, so I've been putting it off for a while now.

Yet fortuitously, a couple days ago I was browsing the Spry docs and noticed two very promising words: Rating Widget.

Surely this cannot be what I'm looking for, could it? Ah but it was!

Recently, Spry updated its growing library of widgets to include a standard "star" rating system. Like it's other widgets, the rating widget comes with a single css file and a single javascript file. And also like other Spry widgets, it is completely simple to implement.

Assuming you have referenced the css and javascript files correctly, here's all it takes to set up a star rating system:

<span id="myrating" class="ratingContainer">        <span class="ratingButton"></span>        <span class="ratingButton"></span>        <span class="ratingButton"></span>        <span class="ratingButton"></span>        <span class="ratingButton"></span>        <input type="text" id="ratingValue" name="dynamic_rate"/>        <span class="ratingRatedMsg">Thanks for voting !</span>    </span> 

It's so simple it's almost laughable. But it gets much better. Like More >