RequireJS Tutorial

Loading the Widget with RequireJS

If you use RequireJS on your website, you also need to load our Widget via RequireJS. To do so, just take a look at our sample snippet below and paste in the code of the Widget you would like to load. Find the unique Widget code in your Widget’s settings under **Install > JavaScript Widget code**.

To use your own on-ready callback function, pass the relevant object to the "load" method ready: function

Our Widget uses a single global object to handle JSONP callbacks. Please make sure not to overwrite the userlike-object in the global scope.

After loading the Widget with a module loader you are still able to reference the Widget in the global scope by calling the "window.userlike" object.