أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
Definitely iframe affects the page load performance and also it is not recommended to use iframe for many page security issues perspective.
You can use instead of iframe : javascript/jquery
this will help :
http://www.dreamincode.net/forums/topic/195687-iframe-replacement/
IFrames cause another call to server after receivin the response. N number of Iframes on a page cause page to perform minimum n+1 calls to server(s). [increases round-trips, transportation and communicaton cost]
SEO companies strongly discourage iframes.
Are now only used for either display of contents with different content-types i.e PDF or might be for some other needs of time.
Of course if your page include many iframe tags it will be slow due to load many pages.
Yes, there is another alternative but it is older than iframe it is frameset tag
There is one alternative to <iframe> and that's the <object> tag.
The onload event isn't guarenteed to fire after all of the DOM has been loaded.
Quite often you'll find the onload event firing way before the DOM has fully loaded, as many a Javascript developer can tell you.
I'd summise from this that your iframe will have little, if any, effect on the onload event firing.
iFrames are somewhat costly, even when left blank when compared with other HTML elements. The biggest drawback is that they block the window onload event until complete, which can make the users perceive that the page they requested is slow.
The do have their uses though in allowing you to compartmentalize external web pages or sandboxing another DOM structure outside of the main page.
Yes iframe effects page loading time and alternative depends on your needs.
My thoughts on this, Presuming you're talking about external sites , If we want alternate to Iframe , don't think there is one foolproof, If we go with CORS enabled AJAX web services , we still need some signature or some dependency for making sure the parameters are same.
Infact if we check SharePoint Apps , they are encouraging Iframe as it gives cleaner separation between2 apps to interact with one another.
The Problems with iFrame:
- Bad For SEO
- No real performance gains.
- <iframe>s Are Bad for Usability
- <iframe>s Can Be Insecure
Alternate:
Masterpages in Asp.net
OR
i am showing jQuery example that includes another html page into your document. This is much more SEO friendly than iframe.
<html>
<header>
<script src="/js/jquery.js" type="text/javascript">
</header>
<body>
<div id='include-from-outside'></div>
<script type='text/javascript'>
$('#include-from-outside').load('http://example.com/included.html');
</script>
</body>
</html>
Anything you add to your page will affect its load time: CSS/JS files, images, iframes or even a text, since everything is loaded by the client.
The matter is: you have to try to deliver your assets in a way that is convenient to the end user, this is why you read or hear things like:
So for iframes: if the iframe is provided by a third party, like Google or FB and that third party offers a async version, choose the async version. If that's not a choice, then you can tel the browser to wait for the important elements of the page to load, then after, add the iframe to your document with JS (jQuery is your friend).
Yes. Iframe affects page load time. Let me try to explain with a simple and easy example:
You have a page and where you have2 iframes added on it which have2 different urls in them. Now this page will try to load3 pages in actual when you will try to open your page.
Does it make any sense to you?