On Dec 27, 8:51 pm, buda <www...@pochta.ru> wrote: > > Of course not: > > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" > > "http://www.w3.org/TR/html4/strict.dtd"> > > <html> > > <head><title></title></head> > > <body foo="bar"> > > <script type="text/javascript"> > > // writes "CSS1Compat" (would print "BackCompat" in Quirks) > > document.write(document.compatMode); > > </script> > > </body> > > </html> > > but this document does not pass validation - "Error found while > checking this document as HTML 4.01 Strict!"
Of course it doesn't. That's because there are invalid attributes, yet you can see how browser still renders document in standard mode. That was exactly the point of this example. You just need to understand that invalid markup and mode switching have nothing to do with each other ; ) > what does this mean for the browser and why should I well form my > document if tere is not difference correct it or not - its in every > case strict document!? You could ask that at c.i.w.a.html [1] > > > Nevertheless, try not to use custom attributes, unless you want to run > > into troubles later on (e.g. remember that the entire DOM in IE is > > implemented in such way that there's no distinction between element > > attributes and properties). > > I dont fully understand what you mean - "> e.g. remember that the > entire DOM in IE is > > > implemented in such way that there's no distinction between element > > attributes and properties)." > > and how should I do in case when I need to somewhere to storemetadata > about every element in a form to make some validation or save their > states? or manipulate with them in case of some rules state in my > bussines rules???? > > Earlie you sad "It is indeed useful" about custom attributes and now > you tell me not to use them ?! > What should I do instead of storin some metadat in elements custom > attributes??? It is useful, but I don't think it's worth the trouble and I personally don't use it. IE's DOM is one example of what makes custom attributes troublesome - you never know which issues you will run into due to every custom attribute ending up as a property of an element. What if attribute name (which becomes a property name) is a reserved word (according to ECMAScript/JScript)? What if it corresponds to some IE's proprietary element property? Which of them takes precedence and which issues it might cause? etc. [1] http://groups.google.com/group/comp.infosystems.www.authoring.html/topics --~--~---------~--~----~------------~-------~--~----~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---