Search Engine Optimization > Web Development > "iframe" vs. "object"
"iframe" vs. "object"
Posted by Andy Mabbett on March 7th, 2006


I do some work on a site which uses iframes. I'm trying to make it 'HTML
4.01 Strict', so should use "object" instead - how widely supported is
that, now (in other words, how out-of-date is
http://www.student.oulu.fi/%7esairwa...est/results/)?

Are there any other issues I should be aware of?

Can anyone give me some real-world examples of object being used to
include HTML from one source, inside a page from another?

Thank you.
--
Andy Mabbett

Say "NO!" to compulsory ID Cards: <http://www.no2id.net/>

Posted by David Dorward on March 7th, 2006

Andy Mabbett wrote:

Using <object> as a replacement for <iframe> introduces all the problems of
iframes coupled with worse browser support.

http://allmyfaqs.net/faq.pl?Problems_with_using_frames

Using HTML 4.01 Strict is part of best practise, but if you want to do
something outside BP then trying to hack it into Strict isn't going to
create even more problems.

Adding the content to the page before it reaches the browser (e.g. on the
server, or on the development machine) is generally a better bet.

http://allmyfaqs.net/faq.pl?Include_one_file_in_another


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Posted by Spartanicus on March 7th, 2006

Andy Mabbett <usenet200309@pigsonthewing.org.uk> wrote:

Embedding HTML is a bad idea, regardless of the element used.

The dates and the browser versions listed there answer that question.

Embedding HTML breaks the fundamental principle of the web: "an url
points to a complete resource". Assuming that the reason to display the
embedded HTML into the calling page is because there is a need to
display the 2 together (the only valid reason to embed), the embedded
content will be indexed and linked to separately from the calling
document.

And then there are UI issues, users will typically have to use a mouse
to drag the scrollbar on the new viewport window to get the content to
scroll, IE does not support mouse-over mouse-wheel scrolling. Browser
support for keyboard operation is very poor and manipulating in document
viewports is not intuitive to many users.

--
Spartanicus

Posted by Jim Ley on March 7th, 2006

On Tue, 7 Mar 2006 18:30:40 +0000, Andy Mabbett
<usenet200309@pigsonthewing.org.uk> wrote:

OBJECT is not a replacement for IFRAME.

Jim.

Posted by Alan J. Flavell on March 7th, 2006

On Tue, 7 Mar 2006, Jim Ley wrote:

No, but (theoretically, anyway) OBJECT *might* be a better answer to
the unstated question than IFRAME was.

Whenever someone asks me how good a replacement Y is for X, I'd want
to know what they were trying to achieve with either of them.

But to address the original question - the last time that I tried
using OBJECT to embed an HTML document into an HTML document, was
years ago: the "outer" one was coded in iso-8859-1, and some of the
then-available browsers (which evidently hadn't read RFC2070) refused
to render Cyrillic, so I embedded the Russian text, encoded in koi8-r
as it was, in an OBJECT. It wasn't very successful, though.

Nowadays, any halfways respectable browser not only understands
RFC2070 but also supports utf-8, so there's no need for any
workarounds on that account.

If the source of the embedded document is under the present author's
control, then I'd recommend genuinely including the substantive
content of the one in the other, rather than trying to use either
OBJECT or IFRAME. If the embedded document isn't under the present
author's control, then they'd shortly be needing to consult lawyers,
I suspect (Shetland Times, anyone?).

As usual, an actual URL showing how the thing is currently being used
(and a statement of any constraints, known legal issues etc. relevant
to the existing situation) would probably assist in reaching an
appropriate verdict.

Posted by Andy Mabbett on March 7th, 2006

In message <Pine.LNX.4.62.0603072142330.26923@ppepc62.ph.gla. ac.uk>,
Alan J. Flavell <flavell@physics.gla.ac.uk> writes
Somewhere in the middle - there are a couple of examples; in one, a
third party supplier will be providing interactive content (some map
based). The content is not within my,/ the site owner's control, but
will be used under a legitimate agreement.

Sorry, but that would be considered a breach of confidence.
--
Andy Mabbett

Say "NO!" to compulsory ID Cards: <http://www.no2id.net/>

Posted by Andy Mabbett on March 7th, 2006

In message
<05mr025tc9lk7h4655ac2h11hri17bmv7u@news.spartanic us.utvinternet.ie>,
Spartanicus <invalid@invalid.invalid> writes
Is that really a "fundamental principle"?
--
Andy Mabbett

Say "NO!" to compulsory ID Cards: <http://www.no2id.net/>

Posted by Spartanicus on March 7th, 2006

Andy Mabbett <usenet200309@pigsonthewing.org.uk> wrote:

T'is if you want that web thing to work.

--
Spartanicus

Posted by Stevie D on March 7th, 2006

Andy Mabbett wrote:

I've not been aware of any problems with the <object>s on my website -
although sometimes they can get a bit messy and invoke scrollbars
depending on the content and layout, but that will often be
acceptable.

I think it's fairly safe to say that a survey carried out when NN4 was
cutting edge and IE5 was still in beta might just be ever-so-slightly
out of date in 2006.

http://www.sjd117.freeserve.co.uk/yo...arch/selby.htm, for
example.

--
Stevie D
\\\\\ ///// Bringing dating agencies to the
\\\\\\\__X__/////// common hedgehog since 2001 - "HedgeHugs"
___\\\\\\\'/ \'///////_____________________________________________

Posted by axel@white-eagle.invalid.uk on March 7th, 2006

Andy Mabbett <usenet200309@pigsonthewing.org.uk> wrote:
No, it isn't. Otherwise any web page which includes a selection
made from a database or includes an RSS stream of headlines would
not match this so-called 'principle'.

Let alone a URL pointing to a web page which includes graphics as
independent images!

Axel

Funbolt.com - Entertainment portal, wallpapers, sexy celebs