mardi 4 août 2015

Server updating the model on changes from other users

Imagine having a website with an input field, a text field and a button. The text field contains the sum of all inputs, from the input field. The button submits the input.

2 users loaded the page at the same time. User 1 enters "10" into the field and presses the button. How can i update the text field on user 2's screen with the new data, without reloading the whole site?

Is the best way, to make a setInterval javascript to check for changes once in a while, or is there a way, where the server could push updates to the users when the model has changed?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire