homepage Welcome to WebmasterWorld Guest from 54.167.144.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
<object> instead of <iframe>?
cperkins

10+ Year Member



 
Msg#: 6539 posted 9:29 pm on Nov 4, 2003 (gmt 0)
I'm working on an XHTML 1.1 (Strict) document. I understand that the IFRAME tag is no longer supported.

But, I believe the <object> tag is supposed to be used in its stead? Is this correct?

If so, does anyone have some sample XHTML that demonstrates this? I know how to use an <object> tag in lieu of an <img>, but how about for another XHTML file?

Thanks,

Chris Perkins

 

cperkins

10+ Year Member



 
Msg#: 6539 posted 11:11 pm on Nov 4, 2003 (gmt 0)

I found the info. Thanks.

[w3.org...]

MonkeeSage

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6539 posted 11:27 pm on Nov 4, 2003 (gmt 0)

Hi Chris,

You have the right idea AFAICT, the <object> will eventually replace the <iframe> (at least it seems that way), but currently it doesn't work in all the browsers.

An example would be:

<object id="page" type="text/html" 
data="page.htm"
width="500" height="600">
<p>Oops! That didn't work...</p>
</object>

Check out this [xml.com] article by Mark Pilgrim for more info (it is dealing with <object> as a replacement for <img>, but it is still relevant).

Nb. Firebird 7 (the nightlies anyway), and Opera 7, and IE6 (SP1 w/ latest cumulative patch), now support <object> with HTML data pretty well (seems they basically treat it as an iframe).

Ps. I only tested with this DTD:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Jordan

MonkeeSage

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6539 posted 12:09 am on Nov 5, 2003 (gmt 0)

Another note, in the three browsers mentioned, you can access the <object> element itself (instead of it's reference, which only has the attributes like type and data) through the window.frames[] collection, just like an iframe, like...

alert(window.frames['framename'].document.body.innerHTML);

or

alert(window.frames[0].document.body.innerHTML);

Jordan

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved