That is, the tags are, the elements are not. A <title> can only appear in a head, that's why my document clearly has a head element – I don't need to spell out the tag for that. And the head ends, and body begins, with the first element that can only be found in body.
For example, validate this: http://snipt.net/nes1983/minimal-valid-html5/ In a HTML5 validator: http://html5.validator.nu/ It's valid. It saves space, no amount of confusion is caused by dropping these tags, so I would argue that it's good practice, when handcoding html, to drop the irrelevant things. I just validated the snipped I'd sent, and I learned that I forgot closing a div at the end of the snippet, otherwise it is valid. Here's the snippet with the closing div, passes through an html5 validator: <!DOCTYPE html> <html lang="en"> <script src="http://www.google.com/jsapi"></script> <script> google.load("prototype", "1.6.1.0"); google.load("scriptaculous", "1.8.3"); document.observe("dom:loaded", function() { Sortable.create('fruit', { "scroll": "container" });}); </script> <title>Test</title> <div id="container" style="overflow: scroll; width: 200px; height: 100px;"> <ul id="fruit"> <li>Apple <li>Banana <li>Peach <li>Strawberry <li>Cherry <li>Pear <li>Orange <li>Mango </ul> </div> Cheers, Niko On Tue, Dec 8, 2009 at 9:27 AM, Niko Schwarz <[email protected]> wrote: > I don't think so. head and body are both optional: > > http://dev.w3.org/html5/spec/Overview.html#optional-tags > > On Tue, Dec 8, 2009 at 1:24 AM, Rick Waldron <[email protected]> wrote: >> Missing: >> >> <head> >> <body> >> >> If found, please return. >> >> -- Sent from my Palm Prē >> ________________________________ >> Niko Schwarz wrote: >> >> I don't know why, but somehow this snippet executes document.observe >> fine. I just open another script tag and suddenly the world is good. >> >> But the issue with the scrolling drag and drop remains. This code >> snippet should be executable in a browser as is, from a file (I can >> attach it as a file if that's easier, or host it on a website): >> >> <!DOCTYPE html> >> <html lang="en"> >> <script src="http://www.google.com/jsapi"></script> >> <script> >> google.load("prototype", "1.6.1.0"); >> google.load("scriptaculous", "1.8.3"); >> </script> >> <script> >> document.observe('dom:loaded',function() { >> Sortable.create('fruit', { >> "scroll": "container" >> }); >> }); >> >> </script> >> >> <title>Test</title> >> <div id="container" style="overflow: scroll; width: 200px; height: 100px;"> >> <ul id="fruit"> >> <li>Apple >> <li>Banana >> <li>Peach >> <li>Strawberry >> <li>Cherry >> <li>Pear >> <li>Orange >> <li>Mango >> </ul> >> >> Cheers, >> >> Niko >> >> On Mon, Dec 7, 2009 at 7:15 PM, Niko Schwarz >> <[email protected]> wrote: >>> Hi, I have this tiny script, and it fails in two ways. First, the >>> document observe thing fails really strangely, saying: >>> >>> TypeError: Result of expression 'document.observe' [undefined] is not >>> a function. >>> >>> The second error, after I create the sorter on the command line: You >>> cannot drag and drop the lower elements of the list. >>> >>> Here's the script: >>> >>> <!DOCTYPE html> >>> <html lang="en"> >>> <script src="http://www.google.com/jsapi"></script> >>> <script> >>> google.load("prototype", "1.6.1.0"); >>> google.load("scriptaculous", "1.8.3"); >>> >>> document.observe("dom:loaded", function() { >>> Sortable.create('fruit', { >>> "scroll": "container" >>> });}); >>> >>> </script> >>> >>> <title>Test</title> >>> <div id="container" style="overflow: scroll; width: 200px; height: >>> 100px;"> >>> <ul id="fruit"> >>> <li>Apple >>> <li>Banana >>> <li>Peach >>> <li>Strawberry >>> <li>Cherry >>> <li>Pear >>> <li>Orange >>> <li>Mango >>> </ul> >>> >>> >>> So, what is your take? >>> >>> >>> Cheers, >>> >>> Niko >>> >>> >>> -- >>> http://scg.unibe.ch/staff/Schwarz >>> twitter.com/nes1983 >>> Tel: +41 076 235 8683 >>> >> >> >> >> -- >> http://scg.unibe.ch/staff/Schwarz >> twitter.com/nes1983 >> Tel: +41 076 235 8683 >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Prototype & script.aculo.us" group. >> To post to this group, send email to >> [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Prototype & script.aculo.us" group. >> To post to this group, send email to >> [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/prototype-scriptaculous?hl=en. >> > > > > -- > http://scg.unibe.ch/staff/Schwarz > twitter.com/nes1983 > Tel: +41 076 235 8683 > -- http://scg.unibe.ch/staff/Schwarz twitter.com/nes1983 Tel: +41 076 235 8683 -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
