Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How to make server force page refresh?

I want a page where everyone sees the same thing. So if one user does something (types, moves an object, etc...) everyone else sees the changes in (almost) real time. Like if two people were playing tic-tac-toe, they would need to see the opponent's move. (Let's say tictactoe is the app)

I wanted to do it with AJAX, and have the tictactoe board be basically 9 divs. I know I could do something like this: When user clicks a div, send an HTTP request and the server will process it accordingly. Then that content will refresh with AJAX to show their move.

But when you do that, is there a way to trigger the opponent's page to refresh so they also see the move? So that when someone makes a move, it HTTP's the server to do what it needs, then the server gives the updated data to viewers to handle and dispaly?

Any other options?

I'm trying to do this on a webhost, otherwise I'd probably use an applet and a dedicated server.

Update:

Like I said, I WOULD do it with Java, except I don't have a server upon which to serve the necessary code. That's why I would prefer it to be in PHP, AJAX, HTTP, etc... that webhosts offer support for.

1 Answer

Relevance
Still have questions? Get your answers by asking now.