Thursday, April 26, 2007
Bloggers: Add Comments, Ratings, and Polls with Two Lines of Javascript
JS-Kit has rolled out an amazing array of blog widgets that let you add comments, ratings, and polls to your blog in about 10 seconds flat. We first mentioned them at a time when they all they had was a comments widget, but it has turned into a real business now with new widgets being churned out every two weeks.
Each widget is just two lines of Javascript that you can add to your blog template. Everything just works. It might seem so simple that it actually becomes hard to understand how everything works.
A cookie keeps track of who the owner of a widget is so you don't even need to sign up. This lets you do things like delete inappropriate comments or add poll questions. Other users can't access these functions. If you happen to lose your cookie, you can reclaim your widgets here.
A tip for users of Blogger.com: If you're using the traditional Blogger template and you want to have ratings on both your main and item pages, you'll need to modify the code to something like this:
You can test out the comments and ratings widgets below this post.
Well, technically 6 lines if you want all three.
Each widget is just two lines of Javascript that you can add to your blog template. Everything just works. It might seem so simple that it actually becomes hard to understand how everything works.
A cookie keeps track of who the owner of a widget is so you don't even need to sign up. This lets you do things like delete inappropriate comments or add poll questions. Other users can't access these functions. If you happen to lose your cookie, you can reclaim your widgets here.
A tip for users of Blogger.com: If you're using the traditional Blogger template and you want to have ratings on both your main and item pages, you'll need to modify the code to something like this:
<div class="js-kit-rating" path="/<$BlogItemNumber$>"></div>The path variable is set to a unique number that will make sure that the widgets on both the main and item pages are synced. This means if you rate an article four stars on the main page and go to the item page, your rating will show up and vice versa. The process is the same for the other two widgets.
<script src="http://js-kit.com/ratings.js"></script>
You can test out the comments and ratings widgets below this post.
Tags:
Labels: Technology