Preskoči na: glavni sadržaj | navigaciju | pretraživanje

jQuery: writing a star rating plugin

by r3dsc0rpi0n on October 30th, 2008.

I’m “in” jQuery for a while now, and I must admit I like it very much. It’s lightweight, crossbrowser and very easy to extend and write. We had an discussion last week about moving from Prototype to some other library, and I decided to write a simple plugin to show how jQuery behaves in a real world example.

Logic was simple, write a plugin:

  • that overrides original markup so users with disabled js would get a form with radio buttons or dropdowns so they can vote too
  • so we can quickly change url of a file that handles db connection and data
  • so we can quickly change maximum vote number
  • that has the option to get current score of something on startup

User is remembered by a cookie so he can chage his vote whenever he wants.
Check out the demo please, or the plugin itself. You can extend and change it, feedback is a must :) Note that this is initial stage of the plugin and there is (always) room for improvements.

I am interested in your opinions on jQuery and/or other libraries, and especially if you are using jQuery how is jQuery behaving in medium or large scale projets.

  1. #1 BuKToP January 5th, 2009

    Great, simple, nice!
    Could you be so kind to give us a simple example of test.php
    I mean some code for connecting with the database, etc.
    I even have no idea what kind of post request this great thing makes :(

  2. #2 r3dsc0rpi0n January 10th, 2009

    You catch the post data as you would in any other “normal” way. Read any ajax tutorial out there and you will get it :)

Speak your mind

Preskoči na: glavni sadržaj | navigaciju | pretraživanje