Forum Moderators: open

Message Too Old, No Replies

IE not loading pages in object, but FF does

         

ntbgl

1:36 pm on Jul 7, 2008 (gmt 0)

10+ Year Member



I have the following line of code in my website. I'm using google just as an example, but other sites have the same results.

<object type="text/html" data="http://www.google.com/" border="none"></object>

In IE nothing shows. In FF the page shows correctly.

If I use a page on my own site then it works in both browsers.

Iframe works well in both browsers, but I'm trying to use object instead, as iframe has been depreciated.

tedster

6:13 pm on Jul 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As far as I know, iframe has not been formally deprecated. The W3C has been discussing the issue for a decade, but no formal action has been taken. One big issue - the iframe element offers behaviors that are not duplicated by the object element, such as targeting. And even if iframe is eventually deprecated, browser support will still go on for years and years to ensure legacy compatibility.

All that said, IE does have dicey support for the object element - at least in some of it's intended uses. So I'd suggest not worrying too much about replacing the iframe element. It works, where object often doesn't.

ntbgl

2:03 pm on Jul 8, 2008 (gmt 0)

10+ Year Member



Thank you for the reply. I thought it was depreciated. It was preventing my code from validating.

Since it was loading local pages, and not remote ones, it dawned on me to just created a local page that used a meta tag redirect. Seemed to work great.

tedster

9:12 pm on Jul 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It was preventing my code from validating.

Ah yes, you probably need one of those silly frameset DTDs to validate. I just ignore that kind of error, since there's no browser compatibility problems. The W3C is a bit intellectually tangled up in this area.

encyclo

10:53 pm on Jul 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A transitional doctype will allow the
iframe
to validate too, it doesn't need to be a frameset one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

tedster

4:58 am on Jul 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right you are, encyclo - I forgot about that obvious approach. If validation is important, you can valdiate to a strict doctype until the only errors are those you can live with, and then swap out the DTD for transitional. It is not a sin!