Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #14478 > unrolled thread
| Started by | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| First post | 2012-06-13 06:37 -0400 |
| Last post | 2012-06-15 04:45 -0400 |
| Articles | 20 on this page of 24 — 7 participants |
Back to article view | Back to comp.lang.javascript
I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-13 06:37 -0400
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-13 06:49 -0400
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-13 07:03 -0400
Re: I copied from a book and still got an error. Stefan Weiss <krewecherl@gmail.com> - 2012-06-13 13:27 +0200
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 00:01 -0400
Re: I copied from a book and still got an error. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-15 06:11 +0000
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 02:24 -0400
Re: I copied from a book and still got an error. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-15 06:38 +0000
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 05:01 -0400
Re: I copied from a book and still got an error. Dr J R Stockton <reply1224@merlyn.demon.co.uk.not.invalid> - 2012-06-16 21:55 +0100
Re: I copied from a book and still got an error. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-17 07:50 +0000
Re: I copied from a book and still got an error. Dr J R Stockton <reply1225@merlyn.demon.co.uk.not.invalid> - 2012-06-19 20:37 +0100
Re: I copied from a book and still got an error. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-06-20 15:10 +0000
Re: I copied from a book and still got an error. Stefan Weiss <krewecherl@gmail.com> - 2012-06-15 15:53 +0200
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 18:07 -0400
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-19 21:22 -0400
Re: I copied from a book and still got an error. Martin Honnen <mahotrash@yahoo.de> - 2012-06-13 13:04 +0200
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 00:01 -0400
Re: I copied from a book and still got an error. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-06-13 14:21 +0300
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 00:01 -0400
Re: I copied from a book and still got an error. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-06-15 08:05 +0300
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 02:37 -0400
Re: I copied from a book and still got an error. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-06-15 09:58 +0300
Re: I copied from a book and still got an error. micky <NONONOmisc07@bigfoot.com> - 2012-06-15 04:45 -0400
Page 1 of 2 [1] 2 Next page →
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-13 06:37 -0400 |
| Subject | I copied from a book and still got an error. |
| Message-ID | <v7qgt7tgkujpet9v55flpi9vrthm5r1dto@4ax.com> |
Hi, guys, it's me again, the newbie from 3 weeks ago. Thanks for the
advice last time.
I had gotten some books even before I posted last time, but I went
back to the library and got more.
Still I'm confused. I think I copied the exact text from JavaScript,
a Begionners Guide by John Pollock, starting with </head>, as below,
but it didnt' work like in the book and www.validator.w3.org gave an
error: "Line 9, Column 10: required attribute "ACTION" not specified"
I know for sure there is no action attibute in the example in the
book.
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title>dontclick</title>
</head>
<body>
<form>
<input value="do not click here" onclick="window.alert('I told you
not to click me!');" type="button">
</form>
</body>
</html>
The book is copyright 2010. Surely not much has changed since then?
This is not the only text I copied out of one book or another, with
modest changes, that did not work as they said it would, but here I
didn't change a thing, I think. I certainly didn't omit the action
attribute.
These books seem to explain the functions in dribs and drabs. Is there
text some place that gives in one place each command with its every
attribute and its form and explanation, like books and help files for
DOS commands?
Thanks a lot.
[toc] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-13 06:49 -0400 |
| Message-ID | <dnrgt7t3sojq9klj8lq6q7afo6g05rjb2h@4ax.com> |
| In reply to | #14478 |
On Wed, 13 Jun 2012 06:37:39 -0400, micky <NONONOmisc07@bigfoot.com>
wrote:
>Hi, guys, it's me again, the newbie from 3 weeks ago. Thanks for the
>advice last time.
>
>I had gotten some books even before I posted last time, but I went
>back to the library and got more.
>
>Still I'm confused. I think I copied the exact text from JavaScript,
>a Begionners Guide by John Pollock, starting with </head>, as below,
>but it didnt' work like in the book and www.validator.w3.org gave an
>error: "Line 9, Column 10: required attribute "ACTION" not specified"
>I know for sure there is no action attibute in the example in the
>book.
FWIW, there is more to the error message, although it seems unrelated:
<form > **
The attribute given above is required for an element that you've used,
but you have omitted it. For instance, in most HTML and XHTML document
types the "type" attribute is required on the "script" element and the
"alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and
type="text/javascript" for <script>.
-- end message --
**The > is in red and separated from the word "form".
><html>
><head>
><meta content="text/html; charset=ISO-8859-1"
>http-equiv="Content-Type">
><title>dontclick</title>
></head>
><body>
> <form>
> <input value="do not click here" onclick="window.alert('I told you
> not to click me!');" type="button">
></form>
></body>
></html>
>
>The book is copyright 2010. Surely not much has changed since then?
>
>
>This is not the only text I copied out of one book or another, with
>modest changes, that did not work as they said it would, but here I
>didn't change a thing, I think. I certainly didn't omit the action
>attribute.
>
>These books seem to explain the functions in dribs and drabs. Is there
>text some place that gives in one place each command with its every
>attribute and its form and explanation, like books and help files for
>DOS commands?
>
>Thanks a lot.
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-13 07:03 -0400 |
| Message-ID | <0psgt79llttv90nt23ch4u7r4b6oe3c1kv@4ax.com> |
| In reply to | #14479 |
I forgot to say I was using Sea Monkey Composer, and it calls Validate. I see that Firefox has an add-on called Firebug, which is supposed to help write webpages. Has anyone tried it. Does it work well? On Wed, 13 Jun 2012 06:49:22 -0400, micky <NONONOmisc07@bigfoot.com> wrote: >On Wed, 13 Jun 2012 06:37:39 -0400, micky <NONONOmisc07@bigfoot.com> >wrote: > >>Hi, guys, it's me again, the newbie from 3 weeks ago. Thanks for the >>advice last time. >> >>I had gotten some books even before I posted last time, but I went >>back to the library and got more. >> >>Still I'm confused. I think I copied the exact text from JavaScript, >>a Begionners Guide by John Pollock, starting with </head>, as below, >>but it didnt' work like in the book and www.validator.w3.org gave an >>error: "Line 9, Column 10: required attribute "ACTION" not specified" >>I know for sure there is no action attibute in the example in the >>book. > >FWIW, there is more to the error message, although it seems unrelated: > > <form > ** > >The attribute given above is required for an element that you've used, >but you have omitted it. For instance, in most HTML and XHTML document >types the "type" attribute is required on the "script" element and the >"alt" attribute is required for the "img" element. > >Typical values for type are type="text/css" for <style> and >type="text/javascript" for <script>. > >-- end message -- > >**The > is in red and separated from the word "form".
[toc] | [prev] | [next] | [standalone]
| From | Stefan Weiss <krewecherl@gmail.com> |
|---|---|
| Date | 2012-06-13 13:27 +0200 |
| Message-ID | <jr9teu$ejq$1@news.albasani.net> |
| In reply to | #14480 |
On 2012-06-13 13:03, micky wrote: > I see that Firefox has an add-on called Firebug, which is supposed to > help write webpages. Has anyone tried it. Does it work well? Yes, it works very well. I use it all the time and can highly recommend it. Most modern browsers have something similar built in now. (There are some very rare cases where the presence of Firebug can actually introduce errors, but I haven't seen one of those for over four years.) As for your question, the code you posted should work fine, apart from the line break in 'I told you not to click me!'. Make sure that your strings start and end on the same line. - stefan
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 00:01 -0400 |
| Message-ID | <4lblt7ljmof1o8eckn5j18g7q0ji0kgpi4@4ax.com> |
| In reply to | #14483 |
On Wed, 13 Jun 2012 13:27:26 +0200, Stefan Weiss <krewecherl@gmail.com> wrote: >On 2012-06-13 13:03, micky wrote: >> I see that Firefox has an add-on called Firebug, which is supposed to >> help write webpages. Has anyone tried it. Does it work well? > >Yes, it works very well. I use it all the time and can highly recommend >it. Most modern browsers have something similar built in now. > >(There are some very rare cases where the presence of Firebug can >actually introduce errors, but I haven't seen one of those for over four >years.) > >As for your question, the code you posted should work fine, apart from >the line break in 'I told you not to click me!'. Make sure that your >strings start and end on the same line. I went back and looked, and the string *was* all on the same line when I wrote it, but Sea Monkey rearranged things. It move type="button" from right after "input" to just before the >, and that left space in the first line, so the string spanned the first and second line!!! Is Sea Monkey screwed up? > >- stefan
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2012-06-15 06:11 +0000 |
| Message-ID | <XnsA073534D35664eejj99@194.109.133.133> |
| In reply to | #14508 |
micky wrote on 15 jun 2012 in comp.lang.javascript: > I went back and looked, and the string *was* all on the same line when > I wrote it, but Sea Monkey rearranged things. This is usenet. Many newsreaders have automatic line cutoff algorisms compensating for malformed postings. On usenet you, the poster, are responsible for keeping the lines consistent with a maximum line length, usually 76 chars. When posting code, don't just copy and paste, but comply with usenet standards, and see if the code still shows what you intended to program. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 02:24 -0400 |
| Message-ID | <5nklt7lqo8nv4g83rg507a3fosdqu0k2c6@4ax.com> |
| In reply to | #14511 |
On 15 Jun 2012 06:11:23 GMT, "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote: >micky wrote on 15 jun 2012 in comp.lang.javascript: > >> I went back and looked, and the string *was* all on the same line when >> I wrote it, but Sea Monkey rearranged things. > >This is usenet. Yes, I know. >Many newsreaders have automatic line cutoff algorisms compensating for >malformed postings. It's not that a line break was inserted where I didn't put one. It's that it moved type="button" from before the value attribute to after it and the onclick text. No newsreader wouldl do that, even if I had been using a newsreader. > >On usenet you, the poster, are responsible for keeping the lines consistent >with a maximum line length, usually 76 chars. Sea Monkey has a newsreader, but there is no reason I would use that to write a webpage. I was usig Sea Monkey Composer which is intended to write HTML and Javascript, and yet it rearranged parts of the code in a way which two people in this thread think, or at the least suspect, created an error. > >When posting code, don't just copy and paste, >but comply with usenet standards, Usenent has nothing to do with this. >and see if the code still shows what you intended to program.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2012-06-15 06:38 +0000 |
| Message-ID | <XnsA07357E572DEBeejj99@194.109.133.133> |
| In reply to | #14512 |
micky wrote on 15 jun 2012 in comp.lang.javascript: > On 15 Jun 2012 06:11:23 GMT, "Evertjan." >>On usenet you, the poster, are responsible for keeping the lines >>consistent with a maximum line length, usually 76 chars. > > Sea Monkey has a newsreader, but there is no reason I would use that > to write a webpage. I was usig Sea Monkey Composer which is intended > to write HTML and Javascript, and yet it rearranged parts of the code > in a way which two people in this thread think, or at the least > suspect, created an error. An erroneous code was posted by you. Why would one care who created it, since you posted it? >>When posting code, don't just copy and paste, >>but comply with usenet standards, > > Usenent has nothing to do with this. On usenet you should inspect if code is still as you wrote it, and compensate for errors that crept in. >>and see if the code still shows what you intended to program. so I wrote. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 05:01 -0400 |
| Message-ID | <jltlt75t5ddiaoomd3g21v3vns16ekrgis@4ax.com> |
| In reply to | #14515 |
On 15 Jun 2012 06:38:29 GMT, "Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote: >micky wrote on 15 jun 2012 in comp.lang.javascript: > >> On 15 Jun 2012 06:11:23 GMT, "Evertjan." >>>On usenet you, the poster, are responsible for keeping the lines >>>consistent with a maximum line length, usually 76 chars. >> >> Sea Monkey has a newsreader, but there is no reason I would use that >> to write a webpage. I was usig Sea Monkey Composer which is intended >> to write HTML and Javascript, and yet it rearranged parts of the code >> in a way which two people in this thread think, or at the least >> suspect, created an error. > >An erroneous code was posted by you. >Why would one care who created it, since you posted it? I certainly care. > >>>When posting code, don't just copy and paste, >>>but comply with usenet standards, >> >> Usenent has nothing to do with this. > >On usenet you should inspect if code is still as you wrote it, >and compensate for errors that crept in. I couldn't do that because I didn't learn until after I posted it that it was wrong to have a string span two lines. I really doubt this is a flaw in Sea Monkey, but who knows. Maybe by the end of my current project, I'll figure out if it is or not. . The problem is that even though I write it the way Stefan and Jukka say to, Sea Monkey Composer rearranges it. Immediately. . I go to preview and back to source and it's rearranged. . I think I'll try shorter strings, only one or two characters, no spaces, so they won't be placed where they span two lines. But not tonight. > >>>and see if the code still shows what you intended to program. > >so I wrote.
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1224@merlyn.demon.co.uk.not.invalid> |
|---|---|
| Date | 2012-06-16 21:55 +0100 |
| Message-ID | <Us6qSQHOLP3PFwvw@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #14511 |
In comp.lang.javascript message <XnsA073534D35664eejj99@194.109.133.133> , Fri, 15 Jun 2012 06:11:23, Evertjan. <exxjxw.hannivoort@inter.nl.net> posted: >micky wrote on 15 jun 2012 in comp.lang.javascript: > >> I went back and looked, and the string *was* all on the same line when >> I wrote it, but Sea Monkey rearranged things. > >This is usenet. > >Many newsreaders have automatic line cutoff algorisms compensating for >malformed postings. YSCIB. AIUI, that word isn't even Dutch. >On usenet you, the poster, are responsible for keeping the lines consistent >with a maximum line length, usually 76 chars. The norm is 72 - but that only applies to text. In code and tables, the lines can be as long as they need to be (up to maybe some large value about a thousand), and transmitted as such - then, at least the better sort of reader will display it as intended. Here in CLJ, we know that script can *always* be adjusted to a 72-character maximum, and that is what the FAQ therefore calls for. IIRC, there was a discussion here a while ago about the minimum line- length needed for JavaScript, disregarding readability. -- (c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME. Web <http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2012-06-17 07:50 +0000 |
| Message-ID | <XnsA075640805FAEeejj99@194.109.133.133> |
| In reply to | #14541 |
Dr J R Stockton wrote on 16 jun 2012 in comp.lang.javascript: > at least the better> sort of reader will display it as intended. "Better" being very subjective. One should not post only for those supposed better readers, posting should be done to be read on all major ones. >>Many newsreaders have automatic line cutoff algorisms compensating for >>malformed postings. > > YSCIB. AIUI, that word isn't even Dutch. postings? cutoff? Indeed, no Dutch. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1225@merlyn.demon.co.uk.not.invalid> |
|---|---|
| Date | 2012-06-19 20:37 +0100 |
| Message-ID | <KeWNeXHBUN4PFwW9@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #14544 |
In comp.lang.javascript message <XnsA075640805FAEeejj99@194.109.133.133> , Sun, 17 Jun 2012 07:50:00, Evertjan. <exxjxw.hannivoort@inter.nl.net> posted: >Dr J R Stockton wrote on 16 jun 2012 in comp.lang.javascript: > >> at least the better> >sort of reader will display it as intended. > >"Better" being very subjective. > >One should not post only for those supposed better readers, >posting should be done to be read on all major ones. > > >>>Many newsreaders have automatic line cutoff algorisms compensating for >>>malformed postings. >> >> YSCIB. AIUI, that word isn't even Dutch. > >postings? cutoff? > >Indeed, no Dutch. Try algorisms. The word has a tenuous existence, and a short Wikipedia page. but does not fit the context. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike 6.05 WinXP. Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2012-06-20 15:10 +0000 |
| Message-ID | <XnsA078AEC8EB9C8eejj99@194.109.133.133> |
| In reply to | #14576 |
Dr J R Stockton wrote on 19 jun 2012 in comp.lang.javascript: > In comp.lang.javascript message <XnsA075640805FAEeejj99@194.109.133.133> > , Sun, 17 Jun 2012 07:50:00, Evertjan. <exxjxw.hannivoort@inter.nl.net> > posted: > >>Dr J R Stockton wrote on 16 jun 2012 in comp.lang.javascript: >> >>> at least the better> >>sort of reader will display it as intended. >> >>"Better" being very subjective. >> >>One should not post only for those supposed better readers, >>posting should be done to be read on all major ones. >> >> >>>>Many newsreaders have automatic line cutoff algorisms compensating for >>>>malformed postings. >>> >>> YSCIB. AIUI, that word isn't even Dutch. >> >>postings? cutoff? >> >>Indeed, no Dutch. > > Try algorisms. The word has a tenuous existence, and a short Wikipedia > page. but does not fit the context. Methought algorism ment the result of quoting Al Gore. You are too serious these days, John, I did not expect a response. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Stefan Weiss <krewecherl@gmail.com> |
|---|---|
| Date | 2012-06-15 15:53 +0200 |
| Message-ID | <jrfeol$5ar$1@news.albasani.net> |
| In reply to | #14508 |
On 2012-06-15 06:01, micky wrote: > On Wed, 13 Jun 2012 13:27:26 +0200, Stefan Weiss > <krewecherl@gmail.com> wrote: >>As for your question, the code you posted should work fine, apart from >>the line break in 'I told you not to click me!'. Make sure that your >>strings start and end on the same line. > > I went back and looked, and the string *was* all on the same line when > I wrote it, but Sea Monkey rearranged things. It move type="button" > from right after "input" to just before the >, and that left space in > the first line, so the string spanned the first and second line!!! > > Is Sea Monkey screwed up? It's possible. I don't use SeaMonkey, so I can't check this myself, but I suspect there is an option for how the editor handles wrapping/breaking of long lines. If there is such an option, try setting it so that lines are never physically broken. If this behavior can't be adjusted, I would switch to a different editor. From your other posts, it sounds like you're still not convinced that the broken string is the reason why your code doesn't work. You can confirm this yourself by editing and saving the file with a simple text editor like Notepad. - stefan
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 18:07 -0400 |
| Message-ID | <udcnt755caiplefbdk2eajp2j94mppnc11@4ax.com> |
| In reply to | #14519 |
On Fri, 15 Jun 2012 15:53:24 +0200, Stefan Weiss <krewecherl@gmail.com> wrote: >On 2012-06-15 06:01, micky wrote: >> On Wed, 13 Jun 2012 13:27:26 +0200, Stefan Weiss >> <krewecherl@gmail.com> wrote: >>>As for your question, the code you posted should work fine, apart from >>>the line break in 'I told you not to click me!'. Make sure that your >>>strings start and end on the same line. >> >> I went back and looked, and the string *was* all on the same line when >> I wrote it, but Sea Monkey rearranged things. It move type="button" >> from right after "input" to just before the >, and that left space in >> the first line, so the string spanned the first and second line!!! >> >> Is Sea Monkey screwed up? > >It's possible. I don't use SeaMonkey, so I can't check this myself, but >I suspect there is an option for how the editor handles >wrapping/breaking of long lines. I'm getting senile. I didnt' check options. At first that made sense because I figured I wouldnt' know what I wanted, but I probalby should have thought of it again. > If there is such an option, try setting >it so that lines are never physically broken. If this behavior can't be >adjusted, I would switch to a different editor. > >From your other posts, it sounds like you're still not convinced that >the broken string is the reason why your code doesn't work. You can >confirm this yourself by editing and saving the file with a simple text >editor like Notepad. Long story. I'll get back to you on this. > >- stefan
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-19 21:22 -0400 |
| Message-ID | <h592u7t8j1sl737f13ffdhhuvi16sap8rb@4ax.com> |
| In reply to | #14524 |
On Fri, 15 Jun 2012 18:07:23 -0400, micky <NONONOmisc07@bigfoot.com> wrote: >On Fri, 15 Jun 2012 15:53:24 +0200, Stefan Weiss ><krewecherl@gmail.com> wrote: > >>On 2012-06-15 06:01, micky wrote: >>> On Wed, 13 Jun 2012 13:27:26 +0200, Stefan Weiss >>> <krewecherl@gmail.com> wrote: >>>>As for your question, the code you posted should work fine, apart from >>>>the line break in 'I told you not to click me!'. Make sure that your >>>>strings start and end on the same line. >>> >>> I went back and looked, and the string *was* all on the same line when >>> I wrote it, but Sea Monkey rearranged things. It move type="button" >>> from right after "input" to just before the >, and that left space in >>> the first line, so the string spanned the first and second line!!! >>> >>> Is Sea Monkey screwed up? >> >>It's possible. I don't use SeaMonkey, so I can't check this myself, but >>I suspect there is an option for how the editor handles >>wrapping/breaking of long lines. > >I'm getting senile. I didnt' check options. At first that made sense >because I figured I wouldnt' know what I wanted, but I probalby should >have thought of it again. > >> If there is such an option, try setting >>it so that lines are never physically broken. If this behavior can't be >>adjusted, I would switch to a different editor. >> >>From your other posts, it sounds like you're still not convinced that >>the broken string is the reason why your code doesn't work. You can >>confirm this yourself by editing and saving the file with a simple text >>editor like Notepad. > >Long story. I'll get back to you on this. Long story short, I took all the spaces out of the message, so it woudn't span two lines (it put it all on the second line) , and it still didn't work. But when I just called the page by opening it as a file in Firefox, it displayed fine and when I clicked on the box, I got my alert, "Itoldyounottoclickme". So I'm having trouble with the thing that Verizon now provides, which no one likes, and with SeaMonkey, but I still have Firefox and Firebug (which I don't really understand yet) , or just Firefox and any text editor. So I went back to an earlier screen that did more (before I retreated and tried something simpler) and it worked fairly well too. It needs debugging but of course it does. >> >>- stefan
[toc] | [prev] | [next] | [standalone]
| From | Martin Honnen <mahotrash@yahoo.de> |
|---|---|
| Date | 2012-06-13 13:04 +0200 |
| Message-ID | <4fd873b0$0$9522$9b4e6d93@newsspool1.arcor-online.net> |
| In reply to | #14478 |
micky wrote:
> Still I'm confused. I think I copied the exact text from JavaScript,
> a Begionners Guide by John Pollock, starting with </head>, as below,
> but it didnt' work like in the book and www.validator.w3.org gave an
> error: "Line 9, Column 10: required attribute "ACTION" not specified"
> I know for sure there is no action attibute in the example in the
> book.
>
> <html>
> <head>
> <meta content="text/html; charset=ISO-8859-1"
> http-equiv="Content-Type">
> <title>dontclick</title>
> </head>
> <body>
> <form>
> <input value="do not click here" onclick="window.alert('I told you
> not to click me!');" type="button">
> </form>
> </body>
> </html>
>
> The book is copyright 2010. Surely not much has changed since then?
Well for comp.lang.javascript a HTML validation error that says that a
required attribute is missing is not that important.
> These books seem to explain the functions in dribs and drabs. Is there
> text some place that gives in one place each command with its every
> attribute and its form and explanation, like books and help files for
> DOS commands?
HTML is a markup language with elements and attributes belonging to
those elements, calling them "commands" is probably not a good way to
approach that language.
As for some reference, it depends on which HTML version you target,
there is HTML 4, documented as a W3C recommendation for more than ten
years, listing the elements here:
http://www.w3.org/TR/html4/index/elements.html, then when you follow the
link for e.g. "FORM" you will find
http://www.w3.org/TR/html4/interact/forms.html#edef-FORM saying
"<!ATTLIST FORM
%attrs; -- %coreattrs, %i18n, %events --
action %URI; #REQUIRED -- server-side form handler --"
Then there is HTML5 which the latest versions of the major desktop
browsers claim to support and I think with HTML5 the W3C validator
considers a document like
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example</title>
</head>
<body>
<form><input></form>
</body>
</html>
valid as with HTML5 the 'action' attribute on the 'form' element is not
mandatory.
--
Martin Honnen --- MVP Data Platform Development
http://msmvps.com/blogs/martin_honnen/
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 00:01 -0400 |
| Message-ID | <frblt7tl8bepvbjvtirnfk11j8p07cpc4n@4ax.com> |
| In reply to | #14481 |
On Wed, 13 Jun 2012 13:04:19 +0200, Martin Honnen <mahotrash@yahoo.de>
wrote:
>micky wrote:
>
>> Still I'm confused. I think I copied the exact text from JavaScript,
>> a Begionners Guide by John Pollock, starting with </head>, as below,
>> but it didnt' work like in the book and www.validator.w3.org gave an
>> error: "Line 9, Column 10: required attribute "ACTION" not specified"
>> I know for sure there is no action attibute in the example in the
>> book.
>>
>> <html>
>> <head>
>> <meta content="text/html; charset=ISO-8859-1"
>> http-equiv="Content-Type">
>> <title>dontclick</title>
>> </head>
>> <body>
>> <form>
>> <input value="do not click here" onclick="window.alert('I told you
>> not to click me!');" type="button">
>> </form>
>> </body>
>> </html>
>>
>> The book is copyright 2010. Surely not much has changed since then?
>
>Well for comp.lang.javascript a HTML validation error that says that a
>required attribute is missing is not that important.
Okay.
>> These books seem to explain the functions in dribs and drabs. Is there
>> text some place that gives in one place each command with its every
>> attribute and its form and explanation, like books and help files for
>> DOS commands?
>
>HTML is a markup language with elements and attributes belonging to
>those elements, calling them "commands" is probably not a good way to
>approach that language.
Okay. ;-(
>
>As for some reference, it depends on which HTML version you target,
>there is HTML 4, documented as a W3C recommendation for more than ten
>years, listing the elements here:
>http://www.w3.org/TR/html4/index/elements.html, then when you follow the
>link for e.g. "FORM" you will find
>http://www.w3.org/TR/html4/interact/forms.html#edef-FORM saying
>"<!ATTLIST FORM
> %attrs; -- %coreattrs, %i18n, %events --
> action %URI; #REQUIRED -- server-side form handler --"
Thanks. Just what I need.
Micky
>Then there is HTML5 which the latest versions of the major desktop
>browsers claim to support and I think with HTML5 the W3C validator
>considers a document like
>
><!DOCTYPE html>
><html lang="en">
><head>
><title>Example</title>
></head>
><body>
><form><input></form>
></body>
></html>
>
>valid as with HTML5 the 'action' attribute on the 'form' element is not
>mandatory.
[toc] | [prev] | [next] | [standalone]
| From | "Jukka K. Korpela" <jkorpela@cs.tut.fi> |
|---|---|
| Date | 2012-06-13 14:21 +0300 |
| Message-ID | <jr9t3j$bkc$1@dont-email.me> |
| In reply to | #14478 |
2012-06-13 13:37, micky wrote:
> I think I copied the exact text from JavaScript,
> a Begionners Guide by John Pollock,
Apparently
http://www.mcgrawhill.ca/professional/products/9780071632959/
which has positive reviews at Amazon.
> but it didnt' work like in the book and www.validator.w3.org gave an
> error: "Line 9, Column 10: required attribute "ACTION" not specified"
> I know for sure there is no action attibute in the example in the
> book.
HTML specifications differ on this: some require the ACTION attribute,
some don't (it defaults to the address of the page itself, which is what
browsers do). Not really a relevant issue here.
> <form>
> <input value="do not click here" onclick="window.alert('I told you
> not to click me!');" type="button">
> </form>
The <form> markup really just confuses, as does the use of an input
element rather than an element with normal text content.
But the issue here is, as you see if you look at your browser's
JavaScript error console, the unterminated string constant. The string
'I told you not to click me!' must be in a single line. In books, we
sometimes have to break lines against the rules and explain somewhat
what we've done, but readers don't read explanations and they get into
trouble.
I think a better example would be just
<p onclick="window.alert('I told you not to click me!')">
do not click here</p>
though it's perhaps not a particularly good example of anything even
after this simplification.
> The book is copyright 2010. Surely not much has changed since then?
Well, quite a lot, but the changes don't affect this issue. By the way,
according to Amazon, the publishing date was September 11, 2009.
>Is there
> text some place that gives in one place each command with its every
> attribute and its form and explanation, like books and help files for
> DOS commands?
Well, JavaScript has no commands, it has statements and functions. Many
books have lists of them, but they tend to be voluminous books, with
lists or tables just summing things up, after about 1,000 pages of prose
and examples.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
[toc] | [prev] | [next] | [standalone]
| From | micky <NONONOmisc07@bigfoot.com> |
|---|---|
| Date | 2012-06-15 00:01 -0400 |
| Message-ID | <pvblt7ha1df8tkdmaftfimjvsh6nk8vjvj@4ax.com> |
| In reply to | #14482 |
On Wed, 13 Jun 2012 14:21:24 +0300, "Jukka K. Korpela"
<jkorpela@cs.tut.fi> wrote:
>2012-06-13 13:37, micky wrote:
>
>> I think I copied the exact text from JavaScript,
>> a Begionners Guide by John Pollock,
>
>Apparently
>http://www.mcgrawhill.ca/professional/products/9780071632959/
>which has positive reviews at Amazon.
>
>> but it didnt' work like in the book and www.validator.w3.org gave an
>> error: "Line 9, Column 10: required attribute "ACTION" not specified"
>> I know for sure there is no action attibute in the example in the
>> book.
>
>HTML specifications differ on this: some require the ACTION attribute,
>some don't (it defaults to the address of the page itself, which is what
>browsers do). Not really a relevant issue here.
>
>> <form>
>> <input value="do not click here" onclick="window.alert('I told you
>> not to click me!');" type="button">
>> </form>
>
>The <form> markup really just confuses, as does the use of an input
>element rather than an element with normal text content.
I thought I needed the input element, in order to make a box in which
to enter text. A box like the box in www.google.com . Text that
will be manipulated after entry.
>
>But the issue here is, as you see if you look at your browser's
>JavaScript error console, the unterminated string constant. The string
>'I told you not to click me!' must be in a single line. In books, we
>sometimes have to break lines against the rules and explain somewhat
>what we've done, but readers don't read explanations and they get into
>trouble.
That makes sense that books don't allways dispilay it like it should
be done, but in this case, as I replied to Stefan, it was on one line
in the book and Sea Monkey rearranged the ....attributes? (moved
type="button") and that split the line.
Sea Monkey makes a lot of changes after I type things in. I mostly
notice indentation and what's above., but I think it does more than
what I've noticed.
>
>I think a better example would be just
>
><p onclick="window.alert('I told you not to click me!')">
>do not click here</p>
>
>though it's perhaps not a particularly good example of anything even
>after this simplification.
>
>> The book is copyright 2010. Surely not much has changed since then?
>
>Well, quite a lot, but the changes don't affect this issue. By the way,
>according to Amazon, the publishing date was September 11, 2009.
Hmmm. I looked just before I typed it. The library has the 3rd
edition. Maybe Amazon is selling the 3rd edition too, but didnt'
update all the description.
>>Is there
>> text some place that gives in one place each command with its every
>> attribute and its form and explanation, like books and help files for
>> DOS commands?
>
>Well, JavaScript has no commands, it has statements and functions. Many
>books have lists of them, but they tend to be voluminous books, with
>lists or tables just summing things up, after about 1,000 pages of prose
>and examples.
Yeah, after my frirst two 450-page books I got from the library two
books over 1000 pages each, the Javascript Bible and another whose
name I forget, but they too both have that little-bit-at-a-time style.
Martin's url looks pretty good
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web