Sometimes it is necessary to wait until a widget is ready before taking some action. For example, you may want to highlight the widget with an animation or add explanatory text or trigger some other client-side behavior once the widget has loaded.
Because of the asynchronous loading of the widget, simply waiting for DOMReady
will not guarantee that the widget has loaded. InGo's widgets provide an onLoad
callback that allows running code in response to the widget's creation. In order to use this callback the JavaScript loading API must be used.
Example
<script src="//cdn.ingo.me/widgets-loader/0.9.1/js/ingo.loader.widget.js"></script>
<script>
$(function() {
InGo.loaderWidget({
"widgetId": "A_WIDGET_ID",
onLoad: function() {
// widget has loaded
}
});
});
</script>
Point of Load
Widget | Point of Load |
---|---|
Activator | Widget has rendered and may be interacted with |
Autofiller (registration) | Widget has loaded and is requesting user's data |
Amplifier | Widget has loaded and is requesting attendee list and contacts |
Authorizer | Widget has loaded and has fired confirmation beacon |
Comments
0 comments
Please sign in to leave a comment.