views:

62

answers:

1

I've got an XHTML 1.1 Strict document that is loading another XHTML 1.1 document in an <object> element (as <iframe> isn't part of the XHTML 1.1 spec). I'm having trouble in IE8 (don't care about 6 or 7) with accessing a javascript variable, Lightbox, in the parent window, from the document loaded in the <object>.

In Firefox and everywhere I've seen online, I can just use window.parent.Lightbox. In IE8 however, I get it being undefined. window.parent does give me an object but it doesn't have my Lightbox variable. I've also tried window.Lightbox, window.top.Lightbox, and window.top.document.Lightbox, but all return undefined.

I should mention I'm using Javascript to set the data property of the <object> - but I don't see how that could affect anything relevant.

What Javascript Fu do I need to do to be able to access my Lightbox variable?

+1  A: 

Switch to a HTML doctype, or even XHTML Transitional. Using the object tag has absolutely no benefits.

Sean Kinsey
Ya, I think I will. I wanted to keep everything 1.1 Strict, but it's becoming such a pain in the butt that it's not worth it.
Pickle
If you have no particular requirements, go for '<!DOCTYPE html>' which is the new HTML5 doctype. And of course, use validation :)
Sean Kinsey