Advantages of Using iframe in webpages - iframe

I used a <iframe> in my web page and its loading takes a long time, even more than loading main web page, Any body could say what are advantages of using <iframe> in a webpage?
And can use another tag instead <iframe>

Iframes are the only cross-browser way to provide html components that are truly separated. So this is their advantage.
But iframes are heavy and do not easily integrate. You may look at the emerging Shadow Dom for an alternative.
There could be more options in your case, but you would have to elaborate.

As you said your iframe content is loading slower than your page, it is the main advantage I have came across for iframe. if you render the things on your page instead of iframe it will take the same time to load the whole page as that of iframe. Your page will be slower.
Second one is , some of the social media buttons are coming in the form of iframe like facebook like and share buttons.

Related

SEO Friendly iFrames-- Non-blocking to parent page from downloading its elements

I am planning to include iFrame in my wordpress site homepage for one reason-- improve homepage speed for SEO purposes. Correct me if I'm wrong, I found out that iframe blocks loading on parent page (old browsers perhaps). Now, here's the idea: I want to divide my homepage into two. The top would be the parent page's light elements and below would be an iframe showing recent posts with heavy elements. I want to load the parent's elements first before the iframe's. Also, prevent browser from showing busy indicator which I intend to use GIF image only on the iframe.
Summary:
Page with SEO friendly iframe.
Loads parent elements first w/o being blocked by iFrame
iframe loads after loading parent page's elements
Prevent showing browser's busy indicator while loading the iframe
Help please.
i dont think there's something like seo friendly iframes. Yes of course in last year google started indexing iframes but it's still worst than normal. (problems with links for iframe sites, google dont know how to index it, or with the same address or with other). It is better to have slow speed, than having iframes(and i am sure of that:) )
If you use a sitemap the spiders will consider the origin page of the iframe as part of the website structure, provided the origin page is hosted in the same domain. Although, the page indexed appearing in a SERP will be the origin page, not the one holding the iframe. This could be confusing to the reader.

Modify content of iframe

If I have and iframe in html page, and within that iframe I need to remove a img tag.
Is it possible to manipulate contents of iframe that loads an external site?
cheers
native security in browsers makes this quite difficult, but it can be done with cross domain messaging; take a look at this library : used it many times; it simply works

Using Javascript to get around SEO concerns

I would like to know at which stage is it okay to start manipulating HTML elements/content using Javascript so as not to impair SEO?
I have read somewhere that HTML content that is hidden using the CSS property display:none is often penalized by Google crawlers, with good reason from what I'm led to believe...I ask this as I intend to have some div panels that are initially hidden, but shown once the user clicks on an appropriate link. My intention is therefore not to hide content from users entirely - just intially to give them a better user experience - I'm afraid Google may not see it that way!
My reason for doing this is to prevent the split second (or in some cases, a full 2 seconds) of ghastly unstyled html elements (positioning), before my Javascript comes in to position, hide and neaten everything up. So adding the display:none at the forefront, and then using Javascript to toggle visibility would have been ideal, but is apparently a no-no with Google Search Engine bot.
Do you experts have any advice? Thank you!
google can now crawl AJAX sites using a simple URL substitution trick; you might be able to take advantage of this to let googlebot see a plain html version of the page for indexing instead of your load-optimized page; see http://code.google.com/web/ajaxcrawling/docs/getting-started.html
If the content in question exists on the page in the html, and is accessible to the user by the time the page finishes loading initially, then you are okay. You want to make sure google can lead a user to your page and see the content in question without requiring further interaction. Adding new content to the html after the initial load (i.e. content from the server), can be problematic for SEO. However if all content is in the html by the end of the page load, then you shouldn't get docked. Keep in mind, good SEO strategy dictates using standard methods of usability so the web crawler can access your content.
Also, each page should follow a content theme. Example: Don't abuse users by hiding five different unrelated blocks of content "medical devices, kazoos, best diners, motorcycles, toxic waste" on one page. Theoretically you could take all of your site's content and lay it out on one page using javascript and 'display:none' waiting for an 'onClick', but that smells like spam.
EDIT, additional info as pertaining to the original question:
The search engine friendly way to display content dynamically is to load it, then hide it from the user.

Does the iframe have any effect on page load time? Why not?

Like the headline says: What effect does iframe have on page load time? Thanks.
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.
Here is a good article on them

Embed asp page without iframe

I want to embed an .asp page on an html page. I cannot use an iframe. I tried:
<object width="100%" height="1500" type="text/html" data="url.asp">
alt : url
</object>"
works great in ff but not ie7. Any ideas? Is it possible to use the object tag to embed .asp pages for IE or does it only work in ff?
I've solved it in the past using Javascript and XMLHttp. It can get a bit hacky depending on the circumstances. In particular, you have to watch out for the inner page failing and how it affects/downgrades the outer one (hopefully you can keep it downgrading elegantly).
Search for XMLHttp (or check this great tutorial) and request the "child" page from the outer one, rendering the HTML you need. Preferably you can get just the specific data you need and process it in Javascript.
You might be able to fake it using javascript. You could either use AJAX to load the page, then insert the HTML, or load "url.asp" in a hidden iframe and copy the HTML from there.
One downside (or maybe this is what you want) is that the pages aren't completely independent, so CSS rules from the outer page will affect the embedded page.
Well, after searching around and testing I don't think it is possible. It looks to me like IE does not allow the object tag access to a resource that is not on the same domain as the parent. It would have worked for me if the content I was trying to pull in was on same domain but it wasn't. If anyone could confirm my interpretation of this it would be appreciated.

Resources