Update Vars or Run Action in JS (WebSocket)
Summary
I want to update some variables or run an action on a websocket event.Content
All,
I setup a websocket in a VB app and want to update some variables or run an action when it is called.
I've seen examples of passing vars into JS functions and returning them, but the function is called due to a websocket onMessage call, so I don't have these handles. Is there a way to get a handle to the vars or call an action?
Example:
PageModule.prototype.onMessage = function(evt) { var data = JSON.parse(evt.data); console.log('message :' + data.label); // I want to update a var or call an action here... }
0