php - jQuery voting system -
so making voting system, thumbs & thumbs down voting system. using cakephp , jquery mysql want make sure front end correct , best way it. i want user able change vote, so utilizing jquery best , efficient way? i'm novice jquery when comes class manipulation. the id field going unique id of photo users voting on. of course test , not going final product in production. there multiple photos on page , user votes or down each of them. here code. <?php echo $javascript->link('jquery/jquery-1.4.2.min',false); ?> <script type="text/javascript"> $(document).ready(function() { $('.vote').click(function () { if ($(this).hasclass("current")) { alert("you have voted option!"); return; } var parentid = $(this).parent("div").attr("id"); if ($(this).hasclass("up")) { //do backend...