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

  • SEARCH
  • Home
  • 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 8611079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:16:59+00:00 2026-06-12T04:16:59+00:00

I have a instant updating comment system(This means that when anyone anywhere post, it

  • 0

I have a instant updating comment system(This means that when anyone anywhere post, it updates instead of having to reload the page.) that uses setInterval to execute AJAX and send it to the server and reload the comments. So, the comments keep blinking. Anyway I need a way to only update the comments when it sees that a phpMyadmin SQL row has been added.

My site: http://learntc.net/index.php

Thanks for any help I get. Just comment if you need more information on something.

  • 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-06-12T04:17:00+00:00Added an answer on June 12, 2026 at 4:17 am

    When you load the comments, each record will have an ID. You will know the highest record ID that is loaded on the page.

    When your JS timer makes the ajax call, have it send that highest loaded ID back to server. Your query can then specify only to load records where the ID is higher than the supplied value. You will then only get records that are newer than the ones on the page.

    Then, when this data is sent back to your page, rather than replacing the whole comment block, simply append the new data onto the end of the existing comment block.

    This will prevent the existing comments from having to be reloaded. It will prevent the flickering, and will also make your SQL queries more efficient, and save you bandwidth from sending the same data over and over again.

    Hope that’s enough of an explanation to get you started.

    Finally, one other thing. Off topic, but I should mention it: I would recommend avoiding the Javascript setInterval() function. Use setTimer() instead, and re-trigger it on each iteration.

    The reason for this is that setInterval() can get itself into problems if any JS code causes a delay. For example, if you have an alert() that the user leaves on screen for a length of time, the setInterval() calls that would have happened while the alert() was blocking the system will all get stacked up and will all be fired in quick succession one after the other as soon as JS gets control back. This can be a serious problem. If you use setTimer() instead, you will avoid this issue.

    For a better explaination, read here: http://bonsaiden.github.com/JavaScript-Garden/#other.timeouts

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a TreeMap, that looks like this: TreeMap<Instant, HashMap<Type, Double>> The Instant values
I see that fiver have implemented an instant pay feature with paypal. Does anyone
I have been working on having a instant messaging system on a website(kind of
i have put that url http://pvpcoach.com/notification.php in Instant Payment Notification setting in my profile
I have written an app that reads incoming chat(somewhat like an instant messenger), formats
I have a Google Instant style jQuery search script that queries a PHP file
I have a Google Instant style jQuery search script that queries a PHP file
I have a Google Instant style jQuery search script that queries a PHP file
I have a simple stored procedure in T-SQL that is instant when run from
I have implemented an autocomplete / instant search on a mobile application that I

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.