No more iframes? | Comments (10)
Posted in Code on 27th November 2006, 12:20 pm by Stuart
This morning I was perusing the links for light reading sent by Russ from the WSG when I came across this article: Insert HTML page into another HTML page, where the author had discovered a way to use the object element instead of iframes to display third party content within a page.
The main issue he had was getting IE to work with this method but ingeniously he solved this problem by working out the classid reference needed to use IE as a plugin to IE. This makes this solution work cross-browser.
In discussion this morning with my colleagues Brad and Mike. Brad went off and made a few optimisations by reducing the need to have separate object markup for IE and everything else as classid is a perfectly valid attribute. He also made a fix to the styling for IE so that the object renders correctly in HTML 4.01 strict too.
See Brad’s test case here: http://intranation.com/test-cases/object-vs-iframe/
Looks like this could be a viable technique that could be used to replace the use of iframes for loading in 3rd party content.

Brilliant! Would love to see some further examples that are a bit more complex and would love to do some low-level testing on them.
Why use the “classid”, when the “codetype”(html4.01-xhtmlstrict) attribute works in Opera, Internet Explorer and Firefox?
example: …object codetype=”text/html” data=”some.html”…
Hi guys & gals,
I ran across this testsuite that might also be helpful with this line of enquiry (they don’t use the classId though).
[...] There is an option, but it is of little practical use since it doesn’t work in Internet Explorer: the object element. Or so it was believed. The other day I came across Stuart Colville’s post No more iframes?. In the post, Stuart points to Aleksandar Vaci?’s article Insert HTML page into another HTML page, which explains a very clever way of using an object element to insert an external HTML document into a page. [...]
When using an object in place of an iframe, how do you “target” links to load into the object as you would with a static navbar that drives content into an iframe?
I tried using the traditional target=”content” and gave my object an id and name of “content” which worked for Firefox, but not for Internet Explorer.
[...] In November last year, Aleksandar Vaci? wrote his post Insert HTML page into another HTML page (found through No more iframes?). Basically, what it is about is finding a way to use an object element instead of an iframe to get the correct behavior in Internet Explorer. [...]
[...] http://www.aplus.co.yu/web-dev/insert-html-page-into-another-html-page/ [...]
Would love it if this worked in IE7. Would be a great alternative to iframes.
This do anything for ya, lads?
OBJECT WIDTH=600 HEIGHT=100
data="test.htm"
/OBJECT
[...] Muffin Research Labs - No more iframes? [...]