Hi Rob, Thanks for the response, and suggestions. A few comments:
> I don't think this question is related to Prototype.js or even > javascript in general, it is an HTML question. You are right that this is not a direct Prototype question, and I probably should have asked somewhere else first, however it is relevant to Prototype users since the default Button dom-nodes produced by Prototype/Scriptaculous are of the self-closing tag form. > However, if you are serving XHTML as HTML (and you must be for IE at > least as it doesn't know what XHTML is) then you are serving invalid > HTML. Whatever happens after that is the result of error correction > and there is no specification for that. Does IE not understand XHTML Doctypes? I have read before (http:// msdn.microsoft.com/en-us/library/ms535242.aspx, etc) that at least for newer versions of IE (possibly even as early as IE6), they are able to understand XHTML doctypes, and from my personal experience, it can make a large difference. > For documents served from a web server, the DOCTYPE in the markup is > irrelevant. Some browsers will use it if content is loaded from a > local file, and validators complain if you don't have one. But > otherwise it serves no purpose (that is not encouragement to drop the > DOCTYPE, it should alwasy be present, it's just a fact of life). http://developer.mozilla.org/en/docs/Mozilla%27s_DOCTYPE_sniffing and http://developer.mozilla.org/en/docs/Mozilla_Web_Developer_FAQ#What_are_the_Quirks_mode_and_the_Standards_mode.3F Take care, Keith > > > instead of separate closing tags. This is the case, > > for example, when the buttons are generated via prototypes Element > > constructor, or with Scriptaculous's Builder class. The result is that > > items following a self-closing button are not displayed. > > If you are serving XHTML as XHTML and use <button ... /> for a button > with no content, you should get the same result as <button></button> > (i.e. a button with no content). > > However, if you are serving XHTML as HTML (and you must be for IE at > least as it doesn't know what XHTML is) then you are serving invalid > HTML. Whatever happens after that is the result of error correction > and there is no specification for that. > > The browser sees the / at the end of the opening tag and ignores it. > It then goes looking for the closing tag and, on seeing content that > looks like markup that doesn't belong inside the button, ignores that > too. Eventually some condition is met and it starts rendering again. > > > > > An example of this is: > > > <!DOCTYPE html > > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > For documents served from a web server, the DOCTYPE in the markup is > irrelevant. Some browsers will use it if content is loaded from a > local file, and validators complain if you don't have one. But > otherwise it serves no purpose (that is not encouragement to drop the > DOCTYPE, it should alwasy be present, it's just a fact of life). > > > > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > > <head> > > <title>IE Button Closing Tags</title> > > > </head> > > <body> > > <!-- ie7 doesn't seem to like it when you use <button /> instead of > > <button></button> --> > > <button style="width:20px; height:10px;" type="button"></ > > button><p>some text</p> > > <button style="width:20px; height:10px;" type="button" /><p>more text? > > </p> > > > </body> > > </html> > > > Does anyone know what the cause of this is? > > Invalid HTML. > > > Firefox, etc. has no > > problems with the later form. > > I beg to differ, for me Firefox does not show the content of the > second paragraph. > > Anyway, that a particular browser might show what you think is correct > isn't really relevant. You are attempting to get consistent behaviour > from invalid markup. You may do that for a limited number of browsers > for a specific case, but you will certainly not do it for browsers in > general, even the few supported by the libraries you are trying to > use. > > -- > Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
