Redlightpacket Posted September 4, 2008 Share Posted September 4, 2008 I'm talking about the thing where you click on to rate the articles. Is there any sample javascript code that could help me with this. Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 4, 2008 Share Posted September 4, 2008 This is more of a PHP (or server-side) question than a JavaScript question. You can write all the javascript you want and you are not going to have those votes saved and displayed to other users or to the same user on different visits. The client-side functionality is made up of simple FORMs with a single button and hidden field that get submitted to the server where the data is saved. <div class="vote-widget"> <div class="vote-count">13<span> votes</span></div> <div class="vote-actions"> <form action="http://www.mixx.com/vote/for/2011901" class="vote-for" method="post"> <input type="hidden" name="collection" value="1" /> <button type="submit" class="submit" title="Vote for"><span class="alt">Vote for</span></button> </form> <form action="http://www.mixx.com/vote/against/2011901" class="vote-against" method="post"> <input type="hidden" name="collection" value="1" /> <button type="submit" class="submit" title="Vote against"><span class="alt">Vote against</span></button> </form> </div> </div> The site then uses CSS to make those buttons appear as images. I don't see any javascript involved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.