design, tips

Using <object> in Internet Explorer

As a web designer I hate Internet Explorer. Microsoft often makes their own rules despite there being rules in place already. I will say however that IE is getting better at following standards with each new version of its browser. The Big Problem™ is that sometimes IE interferes with a page remaining valid XHTML. There is a workaround for almost all of IE quirks, but it is often a long treacherous road to get there, and sometimes the fix is worse than the problem.

One way IE makes life hard is when a person needs to embed a webpage inside a webpage. Admittedly this should almost never happen because it is usually a bad idea. However, sometimes it is a good idea. The only time I’ve found it useful is in my web chess program. It is a good use because I require two separate elements to refresh at different intervals. Also, by limiting what refreshes it cuts down on page load and makes it so the main page never has the refresh blink (that second of white before things load in the browser).

Until now I’ve been using the <iframe> element to embed those pages because it seemed to be the only cross-browser solution. Today I discovered that someone took the long treacherous road and found a way to use the <object> element. The key is the classid:

classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13"

To learn more about using the element and making it work in IE read Brad Wrights discussion of the technique.

update: using the classid above breaks objects in FireFox 3 beta 5

Standard