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 6217967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:31:05+00:00 2026-05-24T07:31:05+00:00

Suppose I’m synchronizing text on an HTML page, stored in localStorage from computer A

  • 0

Suppose I’m synchronizing text on an HTML page, stored in localStorage from computer A to computer B. When the user edits the text on computer A, I send a request to the server, and tell it what text changed. Is there any way that I can get the server to tell computer B that there’s new text, without computer B having to keep checking? I’ve read about Comet, but I’m trying not to use any libraries. Is there a way? Also, if you’re going to suggest Comet, could you give a simple example using plain JavaScript and Comet?

I had an idea, but I don’t know if it’d work. On computer B, I send a request once, and let the server’s file keep delaying the response till there is some new text. That way, it’d be like long-polling, but the request would eventually timeout. If there was a way to set the timeout to be never, this would get much easier. So, anyone have any ideas?

P.S.- I want to use only JavaScript and PHP and try avoid using libraries. Still, if you know of a library that can do this with JS and PHP, please tell me anyway.

Also, I know there have been questions like this, but the answers I found there weren’t satisfactory.

Oh, and if anyone knows how the chat over here works, could you tell me that as well?

tl;dr: I want to send a request from a server to an HTML page, or have the HTML send a single request which is kept alive till an appropriate response is created.

  • 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-24T07:31:06+00:00Added an answer on May 24, 2026 at 7:31 am

    Comet is an implementation of long polling.

    The issue is the host machine needs to keep all the resources available for all of the open requests. Servers must be carefully configured to allow this to work smoothly under load. This is not an “out of the box” solution.

    Another drawback is each user must be bound to a particular server – so there’s no easy way to load-balance requests.

    Sticking with periodic polling is often the best bet.

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

Sidebar

Related Questions

Suppose I have the following HTML snippet: <input type=text id=myinput /> Now I want
Suppose I have the following CSS rule in my page: body { font-family: Calibri,
Suppose I have a Ruby ERB template named my_template.html.erb , and it contains the
Suppose i have a cookie set in first.com say user. Now i want to
Suppose I had a query select name from tbl where dept = 123 which
Suppose I have a form on a page at this location... http://mydomain.com/myform.htm And the
Suppose , i have some x test-cases to be read from input, where each
Suppose application has multiple apks for different countries. If US user with international roaming
Suppose there is a MySQL user alice that is currently connected to the database.
Suppose a mysql 5.5 server uses the following configuration for storing innodb data innodb_data_file_path

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.