Ajax Poll - How to retrieve new score to the correct span id
I want to create an AJAX poll to rate comments. In each comment you can either thumbs up, or thumbs down by clicking on an image. I achieved that part. However, I don't know how to update the score with AJAX in the correct span.
If you don't know what the value of $comment_id is ahead of time, then the onclick event will have to pass this id to the AJAX code so that the AJAX code can send back the returned score to the proper place.
I don't know how to pass the id to AJAX with the onclick event. I'm not very good with JS.
Show the onclick event you're using now to invoke the AJAX process. Also show the HTML around where the onclick event is so that I can see the relationship between where the onclick is and where the response container is.