Solution 1: now sockets¶
Solution 2: pusher
Solution 3: just the traditional techniques
You cannot push data to a browser, but what you can do is set up your webpage to poll your server every few seconds for updates. An example setup would be:
Start that timer on page load.
On the server side you’ll need some sort of system that tracks these events and stores them somewhere such as in a database table with a timestamp. So for example when XYZ creates an account, that would be logged in this “event” table in the db.
The web service called by the AJAX call will then run a query on that table and retrieve all entries since the last time it was called. Then just update the webpage with those results.
It’s obviously not 100% “live” as there will be a small delay depending on what time interval you set in the JS timer but it’s pretty close.