troubleshooting Question

updating data in element without page refresh

Avatar of max7
max7 asked on
JavaScriptScripting LanguagesAJAX
17 Comments1 Solution204 ViewsLast Modified:

I ask this question realizing that there is probably an obvious solution of which I am ignorant, so please don't be surprised if that is the case.

My website allows users to vote for contestants.  I make an ajax call to a web service which checks if the user has already voted in the last 24hrs and if they have not, their vote is recorded for the contestant of their choice.  All this is initiated once they click on the "Vote For This Entry" element.

Problem is, the vote counter only displays the new vote on the page after the page has been refreshed manually.  I want to display the new vote immediately.

When the page loads initially (i.e. before a user places a new vote), I'm successfully bringing in the the voting stats which have been previously recorded for any particular contestant profile.   But what I want is to be able to display new, successful votes immediately after a user places their vote.

Assuming all that was clear, I've tried the following: the success function for the ajax call to the ws and .load().  Neither has worked but it could just be a case that I didn't use them properly or had syntax problems.

I would post code but I don't want to load up unnecessary detail until I hear back from someone and then if requested I can post whatever code is necessary.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 17 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros