Skip to main content

Add loader script


The loader script will read your config and setup a widget on every page where it finds an Online Sizing button.

This loader script can be located anywhere on your page but has to come after the config. Otherwise you will get a JS error telling you that OZ_CONFIG is undefined.

((win, doc, script, key, config, src) => {
win['___OnlineSizing'] = key;
win['___OnlineSizingConfig'] = config;
const js = doc.createElement(script); = key;
js.src = src;
js.async = true;

const scripts = doc.getElementsByTagName(script);
const lastScript = scripts[scripts.length - 1];
lastScript.parentNode.insertBefore(js, lastScript);
})(window, document, 'script', 'oz', OZ_CONFIG, '');