-1

I have a very simple HTML file;

<html>
<body>
<input type="button" value="Button 1"> <input type="button" value="Button 2">
</body>
</html>

Now when a user presses button 1 or button 2, I want the other user to get informed(a popup or a piece of text) (within some seconds) that a button has been pressed.

What technique would you guys use to make this possible? Ajax? Javascript? Any other script?

thanks in avance, Joost

JoostVanPoppel
  • 148
  • 1
  • 7

1 Answers1

1

You need to do Websocket implementation to send real time updates to all other connected users of your application. Simply search for Websocket implementation in framework of your choice, you will find tons of information about it.

Apart from Websocket, you can implement some sort of cloud service like Firebase.

Asad Ullah
  • 2,257
  • 2
  • 24
  • 23
  • Ok, gonna search web sockets... do websockets cause high load/stress on webservers? – JoostVanPoppel Jun 04 '21 at 12:02
  • @JoostVanPoppel how do u host that html in the first place? – The Bomb Squad Jun 04 '21 at 12:03
  • I have a domain/hosting service, apache/php/html/mysql – JoostVanPoppel Jun 04 '21 at 12:04
  • @JoostVanPoppel No, but if not optimized or not handled carefully even http calls can cause high stress on your server. You should read about its performance and how web sockets work in order to design maintainable solution. Give this a read https://stackoverflow.com/questions/23314964/is-there-a-server-cost-to-using-websockets – Asad Ullah Jun 04 '21 at 12:05