VisiSmart script is minified for optimization and speed purposes. Some Shopify page builders throw a syntax error when trying to add the minified script to them (to the Custom liquid) element:
We have an un-minified liquid version of the VisiSmart script for these rare occasions.
Below is a sample, just be sure to replace the ID numbers in the sample below. Replace the bolded 111 with the visi_wid number from your VisiSmart script, also replace the bolded 222 with the visi_pid number from your VisiSmart script.
<!-- VisiSmart Code - DO NOT MODIFY-->
<script async type="text/javascript">
window.visiopt_code = window.visiopt_code || (function() {
var visi_wid = 111,
visi_pid = 222,
visi_flicker_time = 4000,
visi_flicker_element = 'html',
c = false,
d = document,
visi_fn = {
begin: function() {
var a = d.getElementById('visi_flicker');
if (!a) {
var a = d.createElement('style'),
b = visi_flicker_element ? visi_flicker_element + '{opacity:0!important;background:none!important;}' : '',
h = d.getElementsByTagName('head')[0];
a.setAttribute('id', 'visi_flicker');
a.setAttribute('type', 'text/css');
if (a.styleSheet) {
a.styleSheet.cssText = b;
} else {
a.appendChild(d.createTextNode(b));
}
h.appendChild(a);
}
},
complete: function() {
c = true;
var a = d.getElementById('visi_flicker');
if (a) {
a.parentNode.removeChild(a);
}
},
completed: function() {
return c;
},
pack: function(a) {
var b = d.createElement('script');
b.src = a;
b.type = 'text/javascript';
b.innerText;
b.onerror = function() {
visi_fn.complete();
};
d.getElementsByTagName('head')[0].appendChild(b);
},
init: function() {
visi_fn.begin();
setTimeout(function() {
visi_fn.complete();
}, visi_flicker_time);
this.pack('https://visiopt.com/client/js_test/test.' + visi_wid + '.' + visi_pid + '.js');
return true;
}
};
window.visiopt_code_status = visi_fn.init();
return visi_fn;
}());
</script>
<!-- End Of VisiSmart Code -->
Comments
0 comments
Article is closed for comments.