1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Iframe loading and processing

Discussion in 'HTML & Website Design' started by Mulligan81, Oct 6, 2017.

  1. #1
    Having following code
    SEMrush
    <iframe id="myframe" src="..."></iframe>

    <script>
    document.getElementById('myframe').onload = function() {
    alert('myframe is loaded');
    };
    </script>


    i wonder how does the browser processes an iframes? Does it load the iframe content in the separate thread? If so is it run synchronously with the main thread?
     
    Mulligan81, Oct 6, 2017 IP
    SEMrush
  2. SoftLink

    SoftLink Greenhorn

    Messages:
    27
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    8
    #2
    Older browsers definitely use 1 thread. Most current browsers use 1 process.
    Chrome does additional tabs & iframes out of process.
     
    SoftLink, Oct 6, 2017 IP
  3. Mulligan81

    Mulligan81 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    So in the case of "current browsers" does it mean that when the browser hits <iframe> tag it starts a new thread to process & load iframe content while the main thread continues processing the main site code - that is it processes the JavaScript code lying below the iframe tag?
     
    Mulligan81, Oct 6, 2017 IP
  4. SoftLink

    SoftLink Greenhorn

    Messages:
    27
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    8
    #4
    Only in Chrome and what Chrome actually does is questionable.
    Most browsers will run 1 thread.
    For coding a site you should just expect the browser to run 1 thread total.
     
    SoftLink, Oct 6, 2017 IP
  5. Mulligan81

    Mulligan81 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Ok so what is the processing sequence? That one main thread first finishes processing the main site code ended with </html> tag and then starts to load & process the iframe content?
     
    Mulligan81, Oct 6, 2017 IP
  6. SoftLink

    SoftLink Greenhorn

    Messages:
    27
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    8
    #6
    It depends on the browser and you'd have to really study browser internals to find out.
    I doubt that information is available.
     
    SoftLink, Oct 6, 2017 IP
  7. Mulligan81

    Mulligan81 Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    Ok thx for help
     
    Mulligan81, Oct 6, 2017 IP
  8. kk5st

    kk5st Prominent Member

    Messages:
    3,370
    Likes Received:
    339
    Best Answers:
    26
    Trophy Points:
    335
    #8
    Try Mozilla Developer Network. If not on the page I linked, there are others aimed at Firefox developers, too.

    gary

    //edit: For practical purposes, loading an iframe is equivalent to loading an image or object. ~g
     
    Last edited: Oct 9, 2017
    kk5st, Oct 9, 2017 IP
    deathshadow likes this.
  9. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,442
    Likes Received:
    1,511
    Best Answers:
    221
    Trophy Points:
    515
    #9
    Which is part of why we were told with 4 Strict that in the next "real" HTML IFRAME and IMG would be deprecated in favor of OBJECT. This never materialized though as too few people embraced the improvements of Strict (even fewer grasped the concepts), and then the WhatWG came along and pissed on any real improvements inside <body> with their "HTML 5".
     
    deathshadow, Oct 9, 2017 IP
  10. Arun Kumar Soni

    Arun Kumar Soni Active Member

    Messages:
    212
    Likes Received:
    13
    Best Answers:
    2
    Trophy Points:
    65
    #10
    Make sure search robots can access the content in your iFrame. You can do this easily by indexing the iFrame with robots.txt.
     
    Arun Kumar Soni, Oct 9, 2017 IP