PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 7, 2022

[FIXED] How does StackOverflow know when there are new answers to a question?

 September 07, 2022     ajax, forums, javascript     No comments   

Issue

If this question has already been asked I appologies, please point me in the right direction.

I was wondering if anyone has any insight into how StackOverflow pops up the "n new answers have been posted, load new answers" thing at the top of a question when you are adding a post. This seems like a very useful function for my forum web-site and I would like to know how it is done. I assume some ajax or advanced javascript of some kind.


Solution

Look at this SO blog post: https://blog.stackoverflow.com/2008/10/solving-the-fastest-gun-in-the-west-problem/

That said, the one implementable recommendation that came out of this discussion is an active, GMail like notification when you are composing an answer. We agreed with this feature request, so Jarrod implemented it. Here’s how it works:

  1. When you start composing a reply, a timer is created.
  2. Every minute, the page checks itself to see if new answers have arrived.
  3. If new answers arrive, the notification bar will tell you how many, and offer to update the page for you.
  4. Answer updates are performed AJAX style, so they don’t interrupt your current answer.


Answered By - ine
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing