homepage Welcome to WebmasterWorld Guest from 54.227.34.0
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
document type does not allow element "iframe" here
Only error left in adding iframe via custom doctype rules.
JAB Creations

WebmasterWorld Senior Member jab_creations us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4256402 posted 8:51 pm on Jan 21, 2011 (gmt 0)

I've been working to add database stored images to my site however I couldn't find an AJAX solution for uploading files (there is a files draft that will in the years to come be able to be used in conjunction with XMLHttpRequest2) so I've been forced to either use an iframe or Flash.

Since my site is served as XHTML 1.1 in XHTML capable browsers (XHTML 1.0 Strict in non-XHTML capable browsers) naturally encountered the whole anti-frame mentality that was enforced by people in XHTML 1.1 and 1.0 Strict however that's okay because we can add support right back to it.

The only problem is that I'm stuck on the document type does not allow element "iframe" here validation issue however with the following doctype modifications I've been able to resolve the attribute validation errors for the iframe element.

This is the second time I've been forced to modify a doctype. This first set of code allows the border attribute on the frameset element which is the only way to remove borders while using frames...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" [<!ATTLIST frameset border CDATA #IMPLIED>]>


Below is the modified doctype, Safari was the most helpful browser when testing. I've attempted to redeclare the body and divisible elements allowing the iframe however the validator spawned errors so that was a no-go. Thoughts please?

- John

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
[
<!ENTITY % special.extra "iframe">
<!ELEMENT iframe EMPTY>
<!ATTLIST iframe border CDATA #IMPLIED
frameborder (0|1) "0"
id ID #IMPLIED
onfocus CDATA #IMPLIED
scrolling (yes|no|auto) "auto"
src CDATA #REQUIRED
style CDATA #IMPLIED
tabindex CDATA #IMPLIED>
]>

 

tedster

WebmasterWorld Senior Member tedster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4256402 posted 1:33 am on Jan 22, 2011 (gmt 0)

Have you considered changing the doctype to HTML5?

<!DOCTYPE HTML>

All your XHTML mark-up will still be valid then, and so will <iframe>. That's one of the sweet things about HTML5 - it bypasses a lot of the unnecessary rigidity of past versions of HTML/.

JAB Creations

WebmasterWorld Senior Member jab_creations us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4256402 posted 2:37 am on Jan 22, 2011 (gmt 0)

XHTML 1.1 gives me the advantage of having application/xhtml+xml which is absolutely awesome for fixing errors (I find an error and I fix it, period).

XHTML allows me to extend support for everything I've needed so far. When I come to the point of needing to support (X)HTML 5 features I'll simply extend XHTML 1.1 to support those features as well.

(X)HTML 5 does a few things thoughtlessly backwards like moving the noscript element in to the head instead of keeping it in the body element where it belongs and is actually useful.

I've seen people waste entire days because of a missing quote that would otherwise break a page and display an error message. It's a winning formula that has helped me tremendously over the years. Worst case scenario? If I don't find the answer then someone might be able to find a single validation error on my site by manually validating the code while registered, signed in and looking at the prompt in Opera 7.5 or an equivalent scenario; still I'd like to figure this one out if possible. :)

- John

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved