I have a java application that talks via websocket with my javascript webinterface. The webinterface consists of basic form elements such as inputs, radio buttons, a jquery slider and so on. The form fields are monitored by the jQuery .on(change)-Function. If a form field changes by user input the on-change-function triggers the websocket-transmission of the changed-data.
Now there is following problem: If a user in a second instance triggers a change the Java-Server will broadcast the information to every client. Now I want that the form element gets refreshed by changing it's value. But this is impossible because the change will trigger the onchange-event again.
So it will be an endless loop. How to solve that? Is there any way to bypass the .on(change)-Function or do I have to change my design (If yes, how to change?)
Aucun commentaire:
Enregistrer un commentaire