Muffinresearch Labs by Stuart Colville

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.

Post Tools

Comments: Add yours

1. On November 27th, 2006 at 9:21 pm Derek Featherstone said:

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.

2. On December 15th, 2006 at 5:06 pm pigdart said:

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”…

3. On December 18th, 2006 at 3:20 pm Brian McAllister said:

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).

4. On December 20th, 2006 at 11:11 pm Dump iframes and use object elements instead · Webstandarder på Dansk said:

[...] 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. [...]

5. On December 22nd, 2006 at 8:57 pm dwyn said:

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.

6. On January 9th, 2007 at 8:53 am Should we stop using iframes in IE? - Robert’s talk said:

[...] 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. [...]

7. On January 19th, 2007 at 7:45 pm Blogging Web 2.0 Web Design | Technology News | Social Networking | Color Tagging | Ajax | CSS | SEO | Tyic » Dump iframes and use object elements instead said:

[...] http://www.aplus.co.yu/web-dev/insert-html-page-into-another-html-page/ [...]

8. On January 26th, 2007 at 5:42 pm BigA said:

Would love it if this worked in IE7. Would be a great alternative to iframes.

9. On February 14th, 2007 at 1:15 am Jonny said:

This do anything for ya, lads?


OBJECT WIDTH=600 HEIGHT=100
data="test.htm"
/OBJECT

10. On May 19th, 2009 at 3:36 pm Object instead of iFrame | Jesse Bilsten said:

[...] Muffin Research Labs – No more iframes? [...]







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.844s.