You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Update Vars or Run Action in JS (WebSocket)

edited Nov 24, 2018 6:15AM in Visual Builder

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...
    }     

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!