Friday, November 30, 2007

Use object instead of iframe - but it wont work in IE

pencil icon, that"s clickable to start editing the post

In the spring of 2007, when I established my blog, I used quite some energy to make the markup valid. One of the issues was to achieve strict validation which demands that I abandon Iframe, see the post Sweetxml: Valid XHTML - the blogger navigation bar. The other day I was browsing the excellent 456bereastreet, and stumbled upon Dump iframes and use object elements instead. This awoke my strides to make the navbar visible in IE, something I had problems achieving then and to conclude quickly I still have, but now I know exactly why. Before twisting my template I looked like this in IE:

IE screen dump with missing navbar

The post on 456Bereastreet actually was just a reference to the post Insert HTML page into another HTML page. Rushed through the example and tried it out my self to find that the exactly same classid lay as a comment in my template from an earlier attempt. I wasn't let down so I tried it once more, but there was no change. After doing some surfing i read some of the comments to find the answer right there. IE doesn't allow content from other domains (maybe even hosts) and it looks like not even a P3P compact policy might help, since in IE <object/> is obviously viewed as ActiveX per se. With an exact diagnosis it was now possible to look for ways around, but there are none except from creating a custom security setting i IE:

I would suspect many users to have this setting, and it get even worse. Due to the expectation that the content i ActiveX, it gives this warning:

welcome to my innocent and ad-free blog! If a use goes through all this she'll end up with the navbar actually being visible:

The extra vertical scrollbar can be removed with CSS2, but I wont bother since I'll be reverting to my former template again.