<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d601588505461698440', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks

Iframe facts

Key takeaways from Chapter 13: Using Iframes Sparingly of "Even Faster Websites", a guide for performance vigilantes -
  • Relative URLs inside the iframe are resolved relative to the iframe’s base URI, not the parent’s.
  • JavaScript included in the iframe has limited access to the parent. 
  • An iframe from a different domain can’t access the parent’s cookies.
  • Iframes are one to two orders of magnitude more expensive to create than other types of DOM elements.
  • An alternative way to insert ads with better performance would be for the main page to create a DIV to hold the contents of the ad. 
  • We want the onload event to fire as quickly as possible. Iframes block Onload.
  • A workaround to blocking behavior in Safari and Chrome is to set the iframe’s URL dynamically with JavaScript instead of setting it with the HTML SRC attribute.
  • Resources in an iframe are downloaded in parallel with resources in the main page. 
  • Using an iframe does not increase the number of parallel downloads for a given hostname.
  • The connection pool is shared across tabs and windows for all these browsers.
HTML5 has some new attributes, and some HTML 4.01 attributes are not supported in HTML5. 

TODO: Update SearchLite v2, my 2002 script that uses IFrames & give it a makeover

Labels: , ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »


Post a Comment