Add time to an iframe in JS

0
Hello, I'm developing a system and I need JavaScript to add the time between the end of the page load and the click on the iframe content. I tried to use the code below, var myInterval, but in the iframe it is only '1', that is, it does not refresh in the second. After the loaded page it appears that the team ('& t =' + myInterval + ') gets the static number 1.

if(!window.alreadyIncluded) {
    var t = 0;

    var time = 0;
    var myInterval = setInterval(function() {
        ++time;
    }, 1000);

    var divList = document.getElementsByClassName('network');
    for (var i = divList.length - 1; i >= 0; i--) {
        t++;

        var rf = document.referrer;
        var lh = window.location.host;

        var slot = divList[i].getAttribute('data-ad-s');
        var client = divList[i].getAttribute('data-ad-c');
        var width = divList[i].offsetWidth;
        var height = divList[i].offsetHeight;

        divList[i].innerHTML = ('<iframe id="ad_iframe_' + t + '" name="ad_iframe_' + t + '" width="' + width + '" height="' + height + '" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="<?php echo $site->getSiteURL(); ?>/page/generate.php?s=' + slot + '&c=' + client + '&lh=' + lh + '&rf=' + rf + '&t=' + myInterval + '"></iframe>');
    }
    window.alreadyIncluded = true;
}

I have tried in many ways to make myInterval continue to update every second even after full page load, but does it remain static in 1, any idea?

    
asked by anonymous 22.02.2016 / 19:50

0 answers