ForeSee Hosted Code - Calling API Methods

If you want to call product specific API methods you should wrap them in our special acsReady() callback function. The reason for this is that due to the asynchronous way that ForeSee code is loaded onto the page, there is no guarantee that specific methods will be available when you want to use them. Wrapping your calls in acsReady() guarantees that they are. For example, to display the ForeSee survey (cxMeasure) you would call FSR.showInvite(). Using hosted code, this is how you would write that:

// This should appear below the foresee embed snippet
acsReady(function() {
     FSR.showInvite();
});

You can also do this with HTML events:

<a href="#" onclick="acsReady(function(){ FSR.showInvite(); });">Click to launch invitation</a>;

Articles in this section:

  1. Event Logging
  2. API Event Hooks