Prev: -> Ajax using prototype.js blinks image but doesn't display it...Help
Next: Key Codes for some keyboard buttons
From: Scott Sauyet on 22 Jan 2010 13:33 On Jan 22, 12:19 pm, Richard Cornford <Rich...(a)litotes.demon.co.uk> wrote: > On Jan 22, 4:29 pm, Scott Sauyet wrote: > > > On Jan 21, 4:49 pm, Thomas 'PointedEars' Lahn wrote: > > >>> window.onload = function() { > > >> You're really the worst kind of wannabe. Please have the > >> kindness and be quiet until you got your facts right. > >> Thank you in advance. > > >> OP: Don't listen to Scott. > > > OP: Instead, listen to all the useful advice Thomas has given > > so far. Oh wait, all he has offered is non-specific criticism > > of your markup, and a partially-valid critique of my suggestions. > > Assuming the above is not part of a "partially-valid critique" of your > suggestions (as it seems to be a general comment rather than being > about any suggestions made), which part of his "critique" was not > valid? > > Your comments in relation to the mark-up were absolutely wrong (both > in terms of what 'people' were trying to draw attention towards and > the technical aspects of your suggested changes), and Thomas' comments > on it were spot-on. His comments on the "return false;" suggestions > may have started out with a slightly subjective assertion (if one that > I agree with), but the observation that <input type="button"> elements > don't have a default action to be cancelled by such code was making a > valid point. Well, his comments on the mark-up are only valid for HTML doctypes. Whereas this is valid for HTML4 or XHTML: <input type="submit" id="butOne" value="butOne"/> But a major point is that when the OP prefaced the markup with this: | I have something like this (trimmed down) criticizing the markup for its failure to include rows/cols attributes on the textareas or block elements around the form controls or for some spurious commas in what's typed in to this post seems to be pure pettiness. It's certainly not aimed at actually helping the OP solve the problem at hand, as far as I can tell. I guess I should have realized that it was just that sort of pettiness at play, but I'm not sure it was a valid critique to assume that Thomas knew the OP's DOCTYPE, and hence I was wrong. Obviously I did get wrong what others were criticizing in the markup, though. Thomas' critique of my suggestion about "return false" were not only subjective; they also ignored the succeeding paragraph where I explicitly suggested that the OP not change to type="button", but stick with type="submit", for which the default action *is* the form submit we want to cancel. > I do not agree with the section you quoted above. VK is easily "the > worst kind of wannabe" (combining, as he does, a self-created fantasy > understanding of javascript, an inability to understand when he is > shown to be wrong and an approach to reasoning that rarely achieves > lucidity) (sorry, I could not think of a way of expressing that which > does imply that you are also a "wannabe", which is not sort of > terminology that I would normally use, and strikes me as a very > premature conclusion). Actually, I have pretty thick skin. Maybe I am a wannabe. :-) > And being quiet until you get your facts right > would be a very bad idea, and generally unwelcome. As a learning > exercise, it is best to say what you think about the subject and then > listen to the criticism that receives. Agreed. I'm sure I won't be a member of this forum for years on end, but while I am here, I plant to learn what I can, and to share what I've learned. That doesn't involve being quiet, even if I know I'm likely to be wrong fairly often. > And it is in the discussions > that follow from those exchanges that much of the interesting content > on the group can be found. Yes, that's true. But I also would prefer that the environs were at least hospitable to less advanced JS users here earnestly asking for advice. That was the only reason that I bothered to respond to Thomas. I would not have posted my first message on this thread had someone given the OP a competent answer, preferring to learn from the most experienced people here. But all that had been posted were small- minded critiques of the markup. After my response, Asen gave a useful critique of my post offering an improvement to my suggestion for the OP, Gregor gave a less useful response that argued against my suggestions but gave no suggestions for the OP, and Thomas gave one that criticized my solution, insulted me, and still offered no help to the OP. I believe I am not overly sensitive. Had Thomas actually offered competent help to the OP, I would not have responded to his insults. But since the only response was, in essence, "Your markup sucks; go away," I didn't feel Thomas had earned the right to insult my efforts unchallenged. I'm curious as to whether someone in this group, had the OP used the following markup (which I think would be valid in HTML or XHTML), would have posted a more useful response: <form id="aform" method="post" action="myAction"> <p> <input type="submit" id="butOne" value="butOne"/> <textarea id="tx1" rows="3" cols="20"></textarea> <input type="submit" id="butTwo" value="butTwo"/> <textarea id="tx2" rows="3" cols="20"></textarea> </p> </form> Would that have made a difference? Is this newsgroup really that petty? -- Scott
From: Scott Sauyet on 22 Jan 2010 21:32 On Jan 22, 1:56 pm, David Mark <dmark.cins...(a)gmail.com> wrote: > Scott Sauyet wrote: >> I'm curious as to whether someone in this group, had the OP used the >> following markup (which I think would be valid in HTML or XHTML), >> would have posted a more useful response: > >> <form id="aform" method="post" action="myAction"> >> <p> >> <input type="submit" id="butOne" value="butOne"/> >> <textarea id="tx1" rows="3" cols="20"></textarea> >> <input type="submit" id="butTwo" value="butTwo"/> >> <textarea id="tx2" rows="3" cols="20"></textarea> >> </p> >> </form> > >> Would that have made a difference? Is this newsgroup really that >> petty? > > I have no idea what you are talking about. The above is not valid HTML The W3C does not agree with you: http://validator.w3.org/check?uri=http://scott.sauyet.com/Javascript/Demo/2010-01-22d/ http://validator.w3.org/check?uri=http://scott.sauyet.com/Javascript/Demo/2010-01-22c/ -- Scott
From: Thomas 'PointedEars' Lahn on 23 Jan 2010 10:44 Richard Cornford wrote: > I do not agree with the section you quoted above. VK is easily "the > worst kind of wannabe" (combining, as he does, a self-created fantasy > understanding of javascript, an inability to understand when he is > shown to be wrong and an approach to reasoning that rarely achieves > lucidity) (sorry, I could not think of a way of expressing that which > does imply that you are also a "wannabe", which is not sort of > terminology that I would normally use, and strikes me as a very > premature conclusion). And being quiet until you get your facts right > would be a very bad idea, and generally unwelcome. As a learning > exercise, it is best to say what you think about the subject and then > listen to the criticism that receives. And it is in the discussions > that follow from those exchanges that much of the interesting content > on the group can be found. ACK. Sloppy wording on my part. What I meant to say is this: I think it is better for one to refrain from trying to help a newbie if oneself does not yet have a clue what one is talking about (despite having had the opportunity to read a considerable amount of clarifying postings before; that's how I define a wannabe). The confusion that must follow in the newbie by the contradicting and naturally often much more "technical" corrections then (or later, when they find out that what was suggested is not as it works), and the unlearning required, is much more harmful than no answer at all (should nobody knowledgable decide to reply), or the correct answer(s) only. Cf. "If you don't know for sure, say so!", and "If you're going to answer the question at all, give good value." in <http://catb.org/~esr/faqs/smart-questions.html#id383614>. PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16
From: David Mark on 23 Jan 2010 11:55 On Jan 22, 9:32 pm, Scott Sauyet <scott.sau...(a)gmail.com> wrote: > On Jan 22, 1:56 pm, David Mark <dmark.cins...(a)gmail.com> wrote: > > > > > Scott Sauyet wrote: > >> I'm curious as to whether someone in this group, had the OP used the > >> following markup (which I think would be valid in HTML or XHTML), > >> would have posted a more useful response: > > >> <form id="aform" method="post" action="myAction"> > >> <p> > >> <input type="submit" id="butOne" value="butOne"/> > >> <textarea id="tx1" rows="3" cols="20"></textarea> > >> <input type="submit" id="butTwo" value="butTwo"/> > >> <textarea id="tx2" rows="3" cols="20"></textarea> > >> </p> > >> </form> > > >> Would that have made a difference? Is this newsgroup really that > >> petty? > > > I have no idea what you are talking about. The above is not valid HTML > > The W3C does not agree with you: > > http://validator.w3.org/check?uri=http://scott.sauyet.com/Javascript/... > http://validator.w3.org/check?uri=http://scott.sauyet.com/Javascript/... Will you please stop demonstrating your ignorance. Those slashes are errors and will have to be error-corrected by the browser. The fact that the online validation tool now calls them "warnings" instead of errors is irrelevant. It's just a piece of software (and not a particularly good one either). So don't get caught up in the semantics of its messages. ;)
From: Richard Cornford on 23 Jan 2010 12:00
Scott Sauyet wrote: >On Jan 22, 12:19 pm, Richard Cornford wrote: >> On Jan 22, 4:29 pm, Scott Sauyet wrote: >> > On Jan 21, 4:49 pm, Thomas 'PointedEars' Lahn wrote: >> >>>>> window.onload = function() { >> >>>> You're really the worst kind of wannabe. Please have the >>>> kindness and be quiet until you got your facts right. >>>> Thank you in advance. >> >>>> OP: Don't listen to Scott. >> >>> OP: Instead, listen to all the useful advice Thomas has given >>> so far. Oh wait, all he has offered is non-specific criticism >>> of your markup, and a partially-valid critique of my suggestions. >> >> Assuming the above is not part of a "partially-valid critique" of >> your suggestions (as it seems to be a general comment rather than >> being about any suggestions made), which part of his "critique" >> was not valid? >> >> Your comments in relation to the mark-up were absolutely wrong >> (both in terms of what 'people' were trying to draw attention >> towards and the technical aspects of your suggested changes), >> and Thomas' comments on it were spot-on. His comments on the >> "return false;" suggestions may have started out with a slightly >> subjective assertion (if one that I agree with), but the >> observation that <input type="button"> elements don't have a >> default action to be cancelled by such code was making a >> valid point. > > Well, his comments on the mark-up are only valid for HTML doctypes. > Whereas this is valid for HTML4 or XHTML: > > <input type="submit" id="butOne" value="butOne"/> That is a true statement (at least to the extent to which it is possible to declare any mark-up fragment 'valid', given that validity is a quality that only applies to hole documents in this context), but it is a true statement behind which there is an explanation that reveals a very messy truth. HTML is an application of SGML (Standard Generalised Markup Language, as defined in ISO 8879). HTML 4 has an "SGML Declaration" which asserts a set of features from SGML that are (theoretically) used in HTML, and which impact on HTML validity. An extract from that document reads:- | <!SGML "ISO 8879:1986 (WWW)" | -- | SGML Declaration for HyperText Markup Language version HTML 4 | ... | -- | ... | FEATURES | MINIMIZE | DATATAG NO | OMITTAG YES | RANK NO | SHORTTAG YES | | ... So, for example, that "OMITTAG YES" allows HTML to imply opening and closing tags based on (structural) context, in a way that is forbidden in XML (and so in XHTML). The "SHORTTAG YES" makes provision for an SGML shorthand that allows, e.g.:- <title></title> - to be written as:- <title/ -(note that there is no closing chevron in that TITLE element declaration). Thus:- <input type="submit" id="butOne" value="butOne"/ - is a valid HTML element declaration, and so:- <input type="submit" id="butOne" value="butOne"/> - is valid HTML mark-up because it is a valid HTML element declaration followed by a text character in the form of a ">" character. Any context that will allow an INPUT element will also allow such text content just after it, but there are context where text is not allowed, such as inside a HEAD element, which means that mark-up such as:- <head> <title/> </head> - is not valid mark-up as the text chevron implies a closing HEAD tag before it(as text is not allowed in HEAD), and so the (now superfluous) following closing HEAD tag should be the subject of a validity complaint. Now, web browsers do not use full SGML parsers to interpret HTML documents. Instead, they use what are termed 'tag soup' HTML parsers, and these 'tag soup' HTML parsers do not support/recognise the SHORTTAG shorthand (well, with the exception that I have seen reports of one obscure Linux browser that did, for a while as Internet mark-up trends forced them to abandon that practice). When a 'tag soup' parser encounters <title/> it sees the forward-slash character as a typo and error-corrects it out of the document. Thus when it sees:- <input type="submit" id="butOne" value="butOne"/> - it error corrects it back to:- <input type="submit" id="butOne" value="butOne"> - and so the chevron text character that an SGML parser would see does not appear in the browsers output. Thus, your mark-up is valid HTML by virtue of an obscure SGML feature that is unused in (almost all) web browser parsers, and then 'works' in those web browsers by virtue of its being perceived as containing an easily corrected error. This seems to make using such mark-up on the grounds that it is "valid HTML" little but an act of self-delusion; the HTML validator and the browser are not seeing the mark-up as having the same meaning, and the validator's perception is _not_ the interpretation that the author desired of the mark-up. With HTML there is a possibly of creating mark-up that will be interpreted identical by HTML valuators and web browser, achieve the desired outcome, and not necessitate any error-correction processing on the part of the web browsers. Most people, understanding this situation, recommend the exclusive use of such mark-up. > But a major point is that when the OP prefaced the markup with this: > > | I have something like this (trimmed down) > > criticizing the markup for its failure to include rows/cols > attributes on the textareas I did not observe any such criticism, though the absence of NAME attributes is possibly very significant for the OP's story. When we see "Problem is that the two textarea don't seem to post" and textarea elements with no NAME attributes thoughts may go to the notion of a 'successful control" in HTML. | 17.13.2 Successful controls | A successful control is "valid" for submission. Every successful | control has its control name paired with its current value as part | of the submitted form data set. A successful control must be | defined within a FORM element and must have a control name. So where the mark-up shows no NAME attributes we should not expect the textarea's values to be included with any submission to the server. On the other hand, that is pretty basic HTML and so we get to question whether the NAME attributes were among the material "trimmed down". > or block elements around the form controls That would depend on whether the mark-up were supposed to be strict or transitional, which cannot be determined from the fragment shown. > or for some spurious commas in what's typed in to this post Those should be subject to complaint. If we have the assertion that the mark-up is "trimmed down" it is reasonable to assume that what remains was all in the original, even if we cannot know anything about what was omitted. > seems to be pure pettiness. > > It's certainly not aimed at actually helping the OP solve > the problem at hand, as far as I can tell. In order to solve the problem at hand it is first necessary to identify the problem. We are shown mark-up that, in itself, fully explains the statement "the two textarea don't seem to post", but exclude the possibility (or at least significantly reduce the probability, to maybe a small set of 'faulty' browsers) that "Go back to type=submit and everything seems fine" could happen. Conclusion: something critical to the problem has either been "trimmed down" or omitted entirely. Thus the possibility of help getting beyond a parade of blind guesswork always was negligible. > I guess I should have realized that it was just that sort of > pettiness at play, but I'm not sure it was a valid critique > to assume that Thomas knew the OP's > DOCTYPE, and hence I was wrong. I don't think that was unreasonable for Thomas to assume that the browser was using a tag soup HTML parser to process the document (and so would be creating an HTML DOM to be scripted). After all, the mark-up shown is so far from being even well-formed XML, let alone XHTML, that we can be sure that exposing it to an XML Parser would have put up many more red flags, and a long time before any opportunity for scripting entered the picture. Remember that the relationship between a parser and a DOCTYPE is such that the parser needs to have been chosen and be running before any DOCTYPE can be processed. > Obviously I did get wrong what others > were criticizing in the markup, though. > > Thomas' critique of my suggestion about "return false" were not > only subjective; they also ignored the succeeding paragraph where > I explicitly suggested that the OP not change to type="button", > but stick with type="submit", for which the default action *is* > the form submit we want to cancel. If you wanted that read as a suggestion to use a submit type button and then use its onclick handler to cancel the submission you probably wanted to reverse the order of those two comments. My interpretation of what you wrote was that - return false; - suggestion was aimed at the button type input. >> I do not agree with the section you quoted above. VK is easily >> "the worst kind of wannabe" (combining, as he does, a self-created >> fantasy understanding of javascript, an inability to understand >> when he is shown to be wrong and an approach to reasoning that >> rarely achieves lucidity) (sorry, I could not think of a way of >> expressing that which does imply that you are also a "wannabe", >> which is not sort of terminology that I would normally use, and >> strikes me as a very premature conclusion). > > Actually, I have pretty thick skin. Maybe I am a wannabe. :-) > > >> And being quiet until you get your facts right >> would be a very bad idea, and generally unwelcome. As a learning >> exercise, it is best to say what you think about the subject and >> then listen to the criticism that receives. > > Agreed. I'm sure I won't be a member of this forum for years > on end, (Ignoring the fact that this a newsgroup and not a forum, and its not really having members, just participants) Reality may not work up the way you plan it. > but while I am here, I plant to learn what I can, and to share what > I've learned. That doesn't involve being quiet, even if I know I'm > likely to be wrong fairly often. > > >> And it is in the discussions >> that follow from those exchanges that much of the interesting >> content on the group can be found. > > Yes, that's true. But I also would prefer that the environs > were at least hospitable to less advanced JS users here > earnestly asking for advice. That was the only reason that I > bothered to respond to Thomas. > > I would not have posted my first message on this thread had > someone given the OP a competent answer, Where browser scripting is concerned, a general answer of; 'start from the basis of valid HTML mark-up', seems reasonably competent, at least in the face of a question being asked that is at minimum self-contradictory. > preferring to learn from the most experienced people here. You (and anyone else interested) will always learn most from attempting to answer the questions asked by OPs. It is not necessarily a painless process, but it is very effective. > But all that had been posted were small- > minded critiques of the markup. After my response, Asen gave a > useful critique of my post offering an improvement to my > suggestion for the OP, Gregor gave a less useful response that > argued against my suggestions but gave no suggestions for the > OP, and Thomas gave one that criticized my solution, insulted > me, and still offered no help to the OP. > > I believe I am not overly sensitive. Had Thomas actually offered > competent help to the OP, I would not have responded to his > insults. But since the only response was, in essence, "Your markup > sucks; go away," I didn't feel Thomas had earned the right to > insult my efforts unchallenged. On the whole the uncensored/un-moderate nature of (most) newsgroups is a good thing. The price is that nobody is in a position to control what anyone else does (at least so long as they don't breach their news service provider's terms and conditions). Instead the only influence anyone has it on their own actions; by themselves doing the things that they think others should be doing (and so, not doing the things that they think others should not be doing). In that way, a 'common' or 'popular' attitude towards the way things should be done can influence the overall 'attitude' of the group. I have absolutely no time at all for the people who complain about the attitudes/behaviour of others and then contribute nothing positive themselves. They do no more than waste everyone's time/bandwidth. > I'm curious as to whether someone in this group, had the OP used the > following markup (which I think would be valid in HTML or XHTML), > would have posted a more useful response: > > <form id="aform" method="post" action="myAction"> > <p> > <input type="submit" id="butOne" value="butOne"/> > <textarea id="tx1" rows="3" cols="20"></textarea> > <input type="submit" id="butTwo" value="butTwo"/> > <textarea id="tx2" rows="3" cols="20"></textarea> > </p> > </form> > > Would that have made a difference? Those differences actually do little more than introduce another question; Is this real XHTML (sent with an appropriate XHTML Content-type header, to browsers that understand XHTML), or content negotiated (where we have cross DOM issues to consider), or is it formally malformed HTML (only ever sent with HTML Content-type headers)? > Is this newsgroup really that petty? You are likely to find that there is a lot more behind some of the things that seem petty than may be obvious at first sight. Richard. |