Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Nvm found that AJAX is quite useful
i still haven't figure it out but i fell that i am close
Call a server side script
Return response (success / fail )
JS does something with response, like display “thank you for voting” or something
- Implement an async vote request placed from the client side to a server end API.
- POST something like a JSON object to the server:
post_id : 12345,
upvote : 1,
downvote : 0,
user_id : 123,
auth_token : 'blahblah'
- Only allow one vote per user....+1/-1
- Block user from voting on his/her own posts.
- Avoid displaying messages after every vote as it may get annoying.
(Instead you can do something like, change colors on the vote counter to green for upvote and red for downvote)
someDude8So I ve been clinically depressed for about 10 years now. Been really great at hiding it. My illness and lonel...
closer4Is common decency too much to expect? If you give someone a job in the company you work for, do you expect th...
-ANGRY-STUDENT-10I don't know if I should be sad or be happy... It's a few days left until I get back to college from my IT in...