开发者

Embedding Content (iframes) with an HTML 4.01 doctype?

开发者 https://www.devze.com 2022-12-13 08:43 出处:网络
I have some existing code that I have been tasked with upgrading to a valid doctype of HTML4.01 strict.

I have some existing code that I have been tasked with upgrading to a valid doctype of HTML4.01 strict.

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

In the code I've come across an <iframe>, and this does not sit well with the w3 validator.

<iframe 
      OnLoad="javascript: LoadAddAttachmentiFrame('Stock-Attachment-135','/cgi-bin/Xebra?UploadAttachment&amp;s=gnfhcjt7&amp;itemIdentifier=Stock-Attachment-135','gnfhcjt7');" 
      src="/xebrajustadiv.htm" 
      frameborder=0 
      id="Stock-Attachment-135-AttachFrame" 
      name="Stock-Attachment-135-AttachFrame" 
      width="525" 
      height="10">
</iframe>

The w3 validator even seems to claim that <iframe> is not included the html 4.01 strict doctype.

Now I've been to another website where they claim that there is infact another way to embed content within another document. Unfortunately it requires that you use two different methods (one for IE and one for all other browsers); IE uses an ActiveX Object, and the rest of the browsers use an <object> tag. Additiona开发者_JS百科lly the site seems to be refering to an xhtml doctype and not the html 4.01 strict doctype that I am referring to myself.

I don't know what the correct way to embed this content into my html 4.01 strict doctype would be, and additionally I'm concerned that the Javascript that is meant to be called in the onload attribute of the <iframe> tag will not work with the methods suggested in the website; using the ActiveX control for IE and <object> tag for all other browsers.

Note: This question is really better suited to doctype and thus I have posted it there. Unfortunately, it seems that I am more likely to get an answer from someone on stackoverflow, so I have posted it here with a link to the question on doctype.


The iframe is not included as part of HTML 4.01 strict. see http://www.w3schools.com/tags/ref_html_dtd.asp to see what tags are supported by what doc types.


iFrame is valid in html 4. The w3c validator makes mistakes sometimes, I think this bug should be fixed.

0

精彩评论

暂无评论...
验证码 换一张
取 消