JavaScript Loader (Deprecated)
The JavaScript loader is a deprecated method of integrating widgets on a website. The loader will continue to work, but you should use the Web Widget SDK instead.
Once you've generated a URL, you can pass that information on to a JavaScript loader provided by MX. This loader allows you to further configure your Connect Widget, including the size as well as all the supported configuration options, inside the config object.
It also allows you to listen for event messages that indicate loading or a successful member creation.
The event messages handled by onEvent below allow partners to take action in their own codebase in response to events triggered within the Connect Widget's UI. They are intended specifically to allow a partner’s code and the widget's UI to work in concert over a single session, not to give canonical information on the state of a member or other information available by request to the appropriate endpoint, e.g., read member connection status.
Parameters available for the JavaScript loader
| Parameter | Data Type | Description | Required? |
|---|---|---|---|
config | Object | This object allows you to set additional parameters to load the MX Connect Widget in a specific state. | No |
height | String | Desired height of the iframe. Defaults to 600 pixels. | No |
id | String | The id of the DOM element you'll load the widget into. | Yes |
onEvent | Function | A general event handler. Only available with ui_message_version: 4 or higher, which is the required version for the MX Platform API. | No |
width | String | Desired width of the iframe. Defaults to 100% of the parent. | No |
url | String | A URL for the widget provided as a response to the POST request above. | Yes |