Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 761253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:48:57+00:00 2026-05-14T15:48:57+00:00

I have a site with user posted threads that get voted on (up or

  • 0

I have a site with user posted threads that get voted on (up or down), and a vote count is displayed next to each thread.

The voting up and down process is being done through jQuery/Ajax, and using something like this:

$.ajax({
  url: 'vote.php',
  success: function(data) {
    $('.result').html(data);

  }
});

the html of the vote count is being updated (.result being the class of the div that holds the vote count number)

Also, the threads are being sorted first by vote count descending, and then alphabetically.

I’m having a problem with the ajax updating the HTML vote count in real time, i have a hunch that the issue is due to the fact that the order of the threads are changing when the vote count is being updated, but I’m not certain.

I know the database is being updated, and when I refresh the page, it’s also being updated correctly, but I’m not seeing the real-time behavior that I expect from jQuery/Ajax.

What might be the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:48:57+00:00Added an answer on May 14, 2026 at 3:48 pm

    $('.result') will reference all items with the “result” class in the entire document. Are you selectively assigning that class to the item to be updated? In that case you need to show us the code for that.

    Otherwise, you probably want to look at accessing the proper container by something like an ID, that is not affected by how the ordering of items change

    $('#item-' + id).find('.result').html(data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that has subdomains for each user and a wildcard SSL
I have 2 site: example.com and exampletwo.com I want that when a user login
I have a django server that serves the basic site with user, auth etc
Let's say that I have a site where once the user selects a few
I have a private site that requires login for all pages. When a user
I currently have a site with multiple articles being user-generated as content. On each
I have an sql statement that I posted on this site, and I applied
I have a site with the following robots.txt in the root: User-agent: * Disabled:
Hi I have a site where I use a User Table. I want to
I have a site with an image uploader, and whenever a user tries to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.