|
"iframe" and dom problem: msg#00003web.dom.general
I have writing a book on _javascript_, html, dom.
I have encountered a problem on "iframe". In "XHTML 1.0 Strict DTD", iframe element is
deleted.
"iframe" element is in XHTML 1.0 Transitional DTD, XHTML 1.0 Frameset DTD. Regard to iframe element and iframe dom, I have
question. before question, i'll explain my situation. 1) iframe element is deleted in XHTML 1.0 Strict.
using
"<object data="" type="text/html" width="200" height="400"></object>" insted of "<iframe src="" />" is well-formed in "XHTML 1.0 strict". 2) Using object insted of iframe has DOM problems in
browsers.
html code :
<object id="myEmbed" data="" type="text/html" width="200" height="400"></object> I can use below DOM
:
self.document.getElementById("myEmbed").data : it means data attributes of "myEmbed" element (DOM Level 2, works in Mozilla and IE6). self.document.getElementById("myEmbed").contentDocument.lastModified
: self.document.getElementById("myEmbed").contentDocument means document object of "myEmbed" element. it is document object. (DOM Level 2, works in Mozilla not in Mozilla). self.document.getElementById("myEmbed").document.lastModified
: self.document.getElementById("myEmbed").document means document object of "myEmbed" element. it is document object. (DOM Level 2, works in IE. not in Mozilla). Conclusion :
If use "object" istead of iframe, I can't access iframe window object. And for document object, IE6 and mozilla use different name. So using object insted of iframe has problems width regard to
DOM.
3) using "iframe", there is no DOM problem.
html code : <iframe id="myEmbed" src=""></iframe> I can use below DOM
:
self.document.getElementById("myEmbed").contentWindow.location.href : self.document.getElementById("myEmbed").contentWindow is iframe window object. (DOM Level 2, works in IE and Mozilla). self.document.getElementById("myEmbed").contentWindow.document.lastModified
: self.document.getElementById("myEmbed").contentWindow.document is document object of iframe window object. (DOM Level 2, works in IE and Mozilla). 4)
I have to choose ... a. using "object" insted of "iframe". but, it has dom
limitations.
(mozilla and ie is differ in document object referencing. and can't refer window object). b. using "iframe". but, it isn't "xhtml 1.0 strict". So, if use "iframe", use "xhtml 1.0 transitional" instead of "xhtml 1.0 strict". which is best choice?
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: DOM3 Events Specification: keyboard navigation: 00003, Joseph Kesselman |
|---|---|
| Next by Date: | Re: "iframe" and dom problem: 00003, Brad Fults |
| Previous by Thread: | Automatic reply - unavailablei: 00003, Jim Hendler |
| Next by Thread: | Re: "iframe" and dom problem: 00003, Brad Fults |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | Mail Home | sitemap | FAQ | advertise |