I am working on an app where a value is input on page A. This input is placed in a database.
Then page A waits for something to be entered on page B and inserted into the same row.
Page A, while still in session, will need to then pull up the data entered on page B asynchronously.
My first thought was to have a loop that every few seconds requires the database. But that doesn’t sound very safe or efficient.
Is there a better way for page A to get notified of this event?
You can use
long polling and wait for something to happen, once it happens the page on the server will echo something and data will be sent on the client, then using javascript you can act accordingly.