Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 224701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:20:30+00:00 2026-05-11T19:20:30+00:00

We use a modified version of Jiffy to measure actual client-side performance. The most

  • 0

We use a modified version of Jiffy to measure actual client-side performance.

The most important thing we do is measure the time between when the request was received and when the page load event fires in the browser.

On some pages we have iframe elements that point to external sites that we don’t control – they sometimes take a long while to load. At the moment, the page load event for our page fires only after the iframe is completely loaded (and it’s own load event fires).

I’d like to separate these measurements – have one measurement after everything including the iframe is loaded, but also one measurement without the iframe – that is, when the page load would have occured if we didn’t have an iframe.

The only way I’ve managed to do this so far is to add the iframe to the DOM after the page load event, but that delays the loading of the iframe.

Any ideas?

EDIT: bounty is over, thanks for the help and ideas! I chose Jed’s answer because it gave me a new idea – start loading the iframes, but “pause” them so they won’t affect page load (by temporarily setting src="about:blank"). I’ll try to add a more detailed summary of my results.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:20:30+00:00Added an answer on May 11, 2026 at 7:20 pm

    You can achieve this for multiple iframes without dynamically adding them by:

    1. setting the src attribute for all frames to about:blank before body load,
    2. letting the body load event fire,
    3. adding an onload handler to capture the load time of each frame, and then
    4. restoring the src attribute of each frame to its original value.

    I’ve created a frameTimer module that consists of two methods:

    1. an init method that needs to be called immediately before the </body> tag, and
    2. a measure method to be called on page load, which takes a callback with the results.

    The results object is a hash like this:

    {
        iframes: {
            'http://google.co.jp/': 1241159345061,
            'http://google.com/': 1241159345132,
            'http://google.co.uk/': 1241159345183,
            'http://google.co.kr/': 1241159345439
        },
        document: 1241159342970
    }
    

    It returns integers for each load time, but could be easily changed to just return the diff from the document body load.

    Here’s a working example of it in action, with this javascript file (frameTimer.js):

    var frameTimer = ( function() {
        var iframes, iframeCount, iframeSrc, results = { iframes: {} };
    
        return {
            init: function() {
                iframes = document.getElementsByTagName("iframe"),
                iframeCount = iframes.length,
                iframeSrc = [];
    
                for ( var i = 0; i < iframeCount; i++ ) {
                    iframeSrc[i] = iframes[i].src;
                    iframes[i].src = "about:blank";
                }
            },
    
            measure: function( callback ) {
                results.document = +new Date;
    
                for ( var i = 0; i < iframeCount; i++ ) {
                    iframes[i].onload = function() {
                        results.iframes[ this.src ] = +new Date;
                        if (!--iframeCount)
                            callback( results )
                    };
    
                    iframes[i].src = iframeSrc[ i ];
                }
            }
        };
    
    })();
    

    and this html file (frameTimer.html):

    <html>
        <head>
            <script type="text/javascript" src="frameTimer.js"></script>
        </head>
        <body onload="frameTimer.measure( function( x ){ alert( x.toSource() ) } )">
            <iframe src="http://google.com"></iframe>
            <iframe src="http://google.co.jp"></iframe>
            <iframe src="http://google.co.uk"></iframe>
            <iframe src="http://google.co.kr"></iframe>
            <script type="text/javascript">frameTimer.init()</script>
        </body>
    </html>
    

    This could be done in a lot less code (and less obtrusively) with jQuery, but this is a pretty lightweight and dependency-free attempt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to use a modified version of the Lisp snippet from the GNU
This is an example of the code am using. I use a modified version
Apple's iOS SDK use a modified version of pngcrush for converting png files in
If I use a modified usb skeleton driver on Linux and I insmod the
I'm trying to use a modified preg format from preg_match: check birthday format (dd/mm/yyyy)
I've got a BPG file that I've modified to use as a make file
I know you should use POST whenever data will be modified on a public
I have a modified version of the jFeed plugin and now want to pack
I used a slightly modified version of Ryan Scherf's jQuery swipe plugin on a
I've been developing a highly modified version of Lua (including a rewrite of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.