HTML5 validation error

  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

I've been messing around with HTML5 recently as well as using YouTube's new HTML5/WEBM video player.
However, I always get an odd validation error that I don't understand.

Here's a test page, kept simple:

Code: [ Select ]
<!doctype html>

<title>Test</title>
<meta charset="utf-8">

<iframe class="youtube-player" type="text/html" width="355" height="224" src="http://www.youtube.com/embed/OzRmwiSyoZE"></iframe>

</html>
  1. <!doctype html>
  2. <title>Test</title>
  3. <meta charset="utf-8">
  4. <iframe class="youtube-player" type="text/html" width="355" height="224" src="http://www.youtube.com/embed/OzRmwiSyoZE"></iframe>
  5. </html>


The validation error goes like this:

Image


If I put in other attributes it always moans about the last one, whatever it is. When it says "not allowed at this point" does it mean "this point in time"? or "this point marked in red"?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I'm going to say it's referring to "this point in time" based on the rest of the error message.

Quote:
Element-specific attributes for element iframe:
Global attributes
src
name
sandbox
seamless
width
height


In the error, "Global attributes" is a link to the specification, and nowhere in the list is there a "type" attribute.

Come to think of it, this is the first time I've seen a type attribute on an <iframe>, I really can't think of a reason it would be useful.
After dropping that type attribute, I get validation success.
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Posts: 1417
  • Loc: 55° N, 3° W

Post 3+ Months Ago

Ah, I get it now. If the error had said no attribute "type" (in quotes) I wouldn't have been so puzzled. I was thinking of attributes of any type (as in any kind). Jeesh...

Thanks Joebert.

It mentions the type attribute on this page. A draft document though. Maybe the validator is not up to speed yet or somethning.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

It looks like that link is going directly to the attributes of the <embed> element.

The list of generic, or globally available attributes seems to be as follows.

Code: [ Select ]
accesskey
class
contenteditable
contextmenu
dir
draggable
hidden
id
itemid
itemprop
itemref
itemscope
itemtype
lang
spellcheck
style
tabindex
title
  1. accesskey
  2. class
  3. contenteditable
  4. contextmenu
  5. dir
  6. draggable
  7. hidden
  8. id
  9. itemid
  10. itemprop
  11. itemref
  12. itemscope
  13. itemtype
  14. lang
  15. spellcheck
  16. style
  17. tabindex
  18. title


Here's the part of the spec for the <iframe> element.

It seems to be filled with plenty of scary bold red warning messages. I might have to read through this myself as well. :scratchhead:
  • StepWill
  • Novice
  • Novice
  • StepWill
  • Posts: 18

Post 3+ Months Ago

it's because you tried with attributes at first, and in html5, attributes are at last. Like this:

Code: [ Select ]
<iframe src="/html_5/tags/html_iframe_tag_example.cfm" width="200" height="150" seamless></iframe>


Here you have a valid html5 iframe, it complains with w3c standards:

Code: [ Select ]
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<iframe src="/html_5/tags/html_iframe_tag_example.cfm" width="200" height="150" seamless></iframe>
</body>
</html>
  1. <!DOCTYPE html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <title>Untitled Document</title>
  5. </head>
  6. <body>
  7. <iframe src="/html_5/tags/html_iframe_tag_example.cfm" width="200" height="150" seamless></iframe>
  8. </body>
  9. </html>


Hope this helps you.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 58 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.