Welcome to TalkGraphics.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Location
    Upstate NY, USA
    Posts
    373

    Default <object> placeholder won't work with IE7 and earlier?

    Let's say I put a placeholder box on my page and want to bring an external web page into it without using an iframe. This code works in FF and (so I believe) in IE8, but not in IE7. Does anyone know of a workaround that stays XHTML compliant? Many thanks in advance!

    Code:
    <object type="text/html" data="http://www.google.com"
    style="height:100%; width:100%;">
    <p>Alternate text.</p>
    </object>
    "You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa
    Visit Spinland Studios: http://www.spinlandstudios.com

  2. #2
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: <object> placeholder won't work with IE7 and earlier?

    Quote Originally Posted by Spinny View Post
    Let's say I put a placeholder box on my page and want to bring an external web page into it without using an iframe.
    Object is the same as iframe if you have type="text/html".
    Does anyone know of a workaround that stays XHTML compliant?
    The workaround is to use iframe instead. Works fine with all browsers and looks exactly the same as object with html content.
    John.

  3. #3
    Join Date
    Feb 2009
    Location
    Upstate NY, USA
    Posts
    373

    Default Re: <object> placeholder won't work with IE7 and earlier?

    On the flip side, iframes aren't supported by Blackberry browsers, whereas <object> is. I was seeking a way to make the same content work across the board, even for my BBerry-wielding users, and finally found it last night.

    I stuck this in my placeholder:

    Code:
    <!--[if IE]> 
        <object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" type="text/html"
            data="content_to_display.php" style="width:100%;height:100%;">
            <p>Please tell the webmaster you saw this, something is wrong.</p>
        </object>
     <![endif]-->
     <!--[if !IE]><-->
        <object type="text/html" data="content_to_display.php" style="width:100%;height:100%;">
            <p>Please tell the webmaster you saw this, something is wrong.</p>
        </object>
    <!--><![endif]-->
    It works beautifully, even on Blackberries. Only limitation is the content you bring in must be local to the web server for it to work in IE. You can bring in remote URLs for any other browser to see, but Microsoft (as usual) screwed up their implementation of <object>.

    I needed this for a golf league web site where the player data are generated as HTML snippets by a database application. I can bring that data into a Xara-generated static page, but until now was using iframes for the job and several members want to see their handicaps and previous scores on their BBerries. The iframe implementation required them to make an extra click to get to the data directly; now there'll be no need.

    I love finding cool uses for placeholders.
    "You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa
    Visit Spinland Studios: http://www.spinlandstudios.com

  4. #4
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Thumbs up Re: <object> placeholder won't work with IE7 and earlier?

    Pretty good solution.
    Since you are using conditionals, why not just place the <iframe> in the IE version though?
    John.

  5. #5
    Join Date
    Feb 2009
    Location
    Upstate NY, USA
    Posts
    373

    Default Re: <object> placeholder won't work with IE7 and earlier?

    Excellent question! I haven't an answer, except I didn't think of that.
    "You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa
    Visit Spinland Studios: http://www.spinlandstudios.com

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •