is there a way to get the contents of a page, for example http://google.com
, and insert it in the current document, but in the way that the iframe does, I mean... with styles, scripts and everything that page has ?
And make so the styles and scripts don't affect the current document :)
Iframes Bring Security Risks. If you create an iframe, your site becomes vulnerable to cross-site attacks. You may get a submittable malicious web form, phishing your users' personal data. A malicious user can run a plug-in.
IFrames are not obsolete, but the reasons for using them are rare. Using IFrames to serve your own content creates a "wall" around accessing the content in that area. For crawlers like Google, It's not immediately clear that cotent in an iframe will be ranked as highly as if the content were simply part of the page.
iFrames can be used for almost anything, from articles, to website homepages, to learning modules and beyond. As Tech Target explains, “an inline frame (iFrame) is a HTML element that loads another HTML page within the document. It essentially puts another webpage within the parent page.
Inside an iframe, the visual viewport is the size of the inner width and height of the iframe, rather than the parent document. You can set any height and width on an iframe, but the whole document may not be visible.
No, not really: you can get the contents of a page through various AJAX-y techniques, but when you insert them into your page, they'll always have your page's CSS applied to them. You could make some sort of "CSS reset" for the "not-iframe" element, but this will be messy.
Essentially, if you want the separation provided by frames, you need to use frames/iframes (unfortunately, this applies to all content, so CSS will be separated, but also JS, with all the related cross-domain brouhaha).
Absolutely. You can use the object element, like so:
<!DOCTYPE html>
<html>
<body>
<object data="http://www.google.com" type="text/html"></object>
<body>
</html>
(Works with IE8, Chrome 10, FF 4, and Safari 5 on Win XP)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With