0

Is there a way for us know if all the contents inside an iframe are loaded completely and all of them have finished rendering? ( This is specifically for mobile browsers)

I have tried leveraging the following events but all of them are firing before the content inside the iframe is completely rendered.

It is most important for us that this is only triggered after all the content and images inside the iframe are finished rendering. We are attempting to calculate the actual time it takes for a customer to see our fully rendered frame.

      iframe.attachEvent("onload", function () {
            console.log(' placeholder : 1');
        };

     iframe.onload = function () {
            console.log(' placeholder: 2');
       };

     iframe.onreadystatechange = function () {
       if (iframe.readyState == "complete") {
           console.log(' placeholder: 3');
       }

Thanks in advance.

A Kar
  • 9
  • 4
  • If there is asynchronous javascript content would have to poll to see when elements actually exist. – charlietfl Jun 15 '16 at 23:46
  • `attachEvent` is an IE-only method. On IE9+ (in standards mode rather than [in]compatibility mode) and anything other than IE, use `addEventListener`. – T.J. Crowder Jun 15 '16 at 23:50

0 Answers0