I work with an advertising company, where we tag certain pages to track activity. A client of mine wants to fire off a javascript tag to track activity AFTER the page has fi
Here is a code I am using and which is working for me.
window.onload = function(){
setTimeout(function(){
var scriptElement=document.createElement('script');
scriptElement.type = 'text/javascript';
scriptElement.src = "vendor/js/jquery.min.js";
document.head.appendChild(scriptElement);
setTimeout(function() {
var scriptElement1=document.createElement('script');
scriptElement1.type = 'text/javascript';
scriptElement1.src = "gallery/js/lc_lightbox.lite.min.js";
document.head.appendChild(scriptElement1);
}, 100);
setTimeout(function() {
$(document).ready(function(e){
lc_lightbox('.elem', {
wrap_class: 'lcl_fade_oc',
gallery : true,
thumb_attr: 'data-lcl-thumb',
slideshow_time : 3000,
skin: 'minimal',
radius: 0,
padding : 0,
border_w: 0,
});
});
}, 200);
}, 150);
};