FAQ Sections - Feedback Wanted

D

Dr J R Stockton

In comp.lang.javascript message said:
Breaking up the FAQ has been discussed.

http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/d
11878ddfb2ac892/

I'm interested in doing this now. I propose something along the lines of:

* Numbers
* Windows and Frames
* Forms

I would like to hear feedback on this proposal.

That will be the present sections 4 & 5 of <http://www.jibbering.com/faq
/index.html>.

Another category is those questions relating to ECMAScript/DOM without
reference to anything visual or external :-
5.13 How do I trim whitespace?
5.17 How do I make a 10 second delay?
5.20 My element is named myselect[], how do I access it?
5.34 How do I access a property of an object using a string?
5.25 How do I format the lastModified date with javascript?
5.35 When should I use eval?
5.36 Why doesn't the global variable "divId" always refer to the
element with id="divId"?

Another is communication beyond that inherent in ECMAScript and HTML :-
5.3 How can I access the client-side filesystem?
5.4 How can I see in javascript if a web browser accepts cookies?
5.14 How do I force a reload from the server/prevent caching?
5.15 How do I get a perl/asp/php variable into client-side javascript?
5.39 What is Ajax?
5.40 Why is my Ajax page not updated properly when using an HTTP GET
request in Internet Explorer?


Change
5.12 How do I modify the current page in a browser?
to
5.12 How do I modify content in the current page?
since the old wording might be thought to refer to page reloading or
fetching a different page.

In Section 2.3, for citation, it would be helpful of the internal
headings were "numbered", perhaps by typing letters in the source :
A. How to ask ...


If a topic has N entries, and is to be divided with K levels throughout,
then the number of entries in each leaf level must average the Kth root
of N. In deciding the splitting, one should have a weak preference for
leaves to be mostly of similar size.

"Posting Code" has 72 twice.
 
D

dhtml

Dr said:
That will be the present sections 4 & 5 of <http://www.jibbering.com/faq
/index.html>.

Another category is those questions relating to ECMAScript/DOM without
reference to anything visual or external :-

An 'Other' category?
5.13 How do I trim whitespace?
5.17 How do I make a 10 second delay?
5.20 My element is named myselect[], how do I access it?

That one seems like it belongs in 'Forms' section, to me.

5.34 How do I access a property of an object using a string?
5.25 How do I format the lastModified date with javascript?
5.35 When should I use eval?
5.36 Why doesn't the global variable "divId" always refer to the
element with id="divId"?

Another is communication beyond that inherent in ECMAScript and HTML :-
5.3 How can I access the client-side filesystem?
5.4 How can I see in javascript if a web browser accepts cookies?

Cookies is part of the DOM (document.cookie). But then so are forms.
5.14 How do I force a reload from the server/prevent caching?
5.15 How do I get a perl/asp/php variable into client-side javascript?
5.39 What is Ajax?
5.40 Why is my Ajax page not updated properly when using an HTTP GET
request in Internet Explorer?


Change
5.12 How do I modify the current page in a browser?
to
5.12 How do I modify content in the current page?
OK.

since the old wording might be thought to refer to page reloading or
fetching a different page.

In Section 2.3, for citation, it would be helpful of the internal
headings were "numbered", perhaps by typing letters in the source :
A. How to ask ...

That can be changed to an OL element using list-style to determine the
marker type.

list-style-type: iroha;

If a topic has N entries, and is to be divided with K levels throughout,
then the number of entries in each leaf level must average the Kth root
of N. In deciding the splitting, one should have a weak preference for
leaves to be mostly of similar size.

Size as "number of items" or "amount of text"? It might be worth
considering the amount of text sent out in the bi-weekly mailings.
 
D

dhtml

Peter said:
I don't see any benefit to breaking up the document. Better to focus
on the actual content than worry about the packaging.

It's easier to find stuff if its organized into meaningful sections
("Section 5" doesn't have much meaning as "Forms" for example). People
usually scan through.

We had several questions related to math and numbers interspersed with
questions about frames, preventing access to a web page, get the value
of a form control, etc.. A burgeoning document like the CLJ FAQ is not
easy to scan through, especially with the some of the "quick" answers
being several paragraphs (that includes the one I added about window
size). I created a numbers section. I want to create more sections.

http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/b5c32520edf6db97/
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton wrote:

An 'Other' category?

I think that the idea of features related only to the manipulation of
ordinary variables deserves a subsection, and with a better title than
"Other", though I have no title suggestion. It would accommodate string
manipulation and maybe date/time, for example; also function grammar.
5.13 How do I trim whitespace?
5.17 How do I make a 10 second delay?
5.20 My element is named myselect[], how do I access it?

That one seems like it belongs in 'Forms' section, to me.

Is such an element necessarily in a form? It should be next to 5.34, or
maybe merged.
Cookies is part of the DOM (document.cookie). But then so are forms.

Cookies are not really part of the document; they do not show. The
headings must relate to naive user expectations, not to technicalities.


Size as "number of items" or "amount of text"? It might be worth
considering the amount of text sent out in the bi-weekly mailings.

I meant "number of items". While the number of weekly bytes used to
post FAQ articles is less than that used to discuss them, there's no
cause for concern. Exceptionally large or small sections are of course
candidates for putting elsewhere or merging.


At present there is a 1:1 mapping between questions (as precedes Section
1) and answers (bodies in Sections 4 & 5). But sometimes quite
different questions have substantially similar answers. One could start
with a list of questions, each with a link (or more?) to the relevant
answers, those having subject lines describing their contents.

Crude example :
Q1 : Trim strings?
Q2 : Add leading zero?
Q3 : Read "YYYY-MM-DD"?
could all point to
A3 : Use of RegExps
(not that RegExps look efficient for LZ; but they are possible).
 
D

dhtml

Dr said:
I think that the idea of features related only to the manipulation of
ordinary variables deserves a subsection,

Ah, but what is ordinary?

and with a better title than
"Other", though I have no title suggestion. It would accommodate string
manipulation and maybe date/time, for example; also function grammar.

"Objects and Types" ?
+ "Numbers"
+ "Objects"
+ "Strings and Regexes"
+ "Dates"


The thinking behind having "Strings and Regexes" as one category is that
it's more task-oriented. How do I do [x] with a string?
5.13 How do I trim whitespace?
5.17 How do I make a 10 second delay?
5.20 My element is named myselect[], how do I access it?
That one seems like it belongs in 'Forms' section, to me.

Is such an element necessarily in a form? It should be next to 5.34, or
maybe merged.

It could be a form control in a form, an attribute, a form element. Most
of the time it will be a problem with a form control.

In PHP, elements with shared name would have to be named with a "[]", as
in "things[]". I don't know if they ever fixed that.


Cookies are not really part of the document; they do not show. The
headings must relate to naive user expectations, not to technicalities.


Many things in the DOM do not show, e.g. document.defaultView,
document.getElementsByTagName, document.images, document.doctype,
document.referrer, document.URL, document.domain, document.createEvent.

At present there is a 1:1 mapping between questions (as precedes Section
1) and answers (bodies in Sections 4 & 5). But sometimes quite
different questions have substantially similar answers. One could start
with a list of questions, each with a link (or more?) to the relevant
answers, those having subject lines describing their contents.

A question could lead to a specific answer within that section. It
might be the case that the answer links to another answer, which exists
in a different section.

Sub-subsections might seem like a good idea but would require change to
the XML and the scripts that process that to text and HTML. I would like
to avoid that, if possible.

What do you think of:

,--------------------------------------------------------------------
|
| • Meta-FAQ meta-questions
| * Which newsgroups deal with javascript?
| * What questions are on-topic for CLJ?
| * What should I do before posting to CLJ?
| * Why was my post not answered?
| * Why do some posts have <FAQENTRY> in them?
| * How do I make a suggestion?
|
| • Javascript Tips
| o What is ECMAScript?
| o What is JScript?
| o What are object models?
| o What is the document object model?
| o Internationalisation and Multinationalisation in javascript.
| o Where are the CLJ archives located?
| o What does the future hold for ECMAScript?
|
| • Javascript Resources
| o What books cover javascript?
| o What online resources are available?
|
| • Dates
| o How do I format the lastModified date with javascript?
| • Numbers
| o How do I convert a Number into a String with exactly 2 decimal
| places?
| o Why does simple decimal arithmetic give strange results?
| o Why does K = parseInt('09') set K to 0?
| o Why does 1+1 equal 11? or How do I convert a string to a number?
| o How do I generate a random integer from 1 to N?
| • Objects
| o When should I use eval?
| o How do I access a property of an object using a string?
| • Strings and RegExps
| o How do I trim whitespace?
|
| • DOM and Forms
| o How do I get the value of a form control?
| o My element is named myselect[], how do I access it?
| o Why doesn't the global variable "divId" always refer to the
| element with id="divId"?
| o Why are my rollovers so slow?
| o How do I disable the right mouse button?
| o How do I detect Opera/Netscape/IE?
| o How do I modify the content of the current page?
| o How can I see in javascript if a web browser accepts cookies?
|
| • Windows and Frames
| o How do I communicate between frames in a web browser?
| o Why does framename.print() not print the correct frame in IE?
| o How do I change print settings with window.print()?
| o I have window.status="Moomin"; why doesn't the statusbar
| change?
| o How can I disable the back button in a web browser?
| o How do I find the size of the window?
| o How do I change the text in the url/location bar?
| o How do I POST a form to a new window?
| o How do I change the confirm box to say yes/no or default to
| cancel?
| o Why do I get permission denied when accessing a frame/window?
| o How do I modify the content of the current page?
| o How do I prompt a "Save As" dialog for an accepted mime type?
| o How do I open a new window with javascript?
| o How do I check to see if a child window is open, before opening
| another?
| o How do I close a window and why does it not work on the first
| one?
| o How do I make a 10 second delay?
|
| • Ajax
| o What is Ajax?
| o Why is my Ajax page not updated properly when using an HTTP GET
| request in Internet Explorer?
| o How do I download a page to a variable?
| o How do I get a perl/asp/php variable into client-side
| javascript?
| o How do I log-out a user when they leave my site?
| o How do I run a server side script?
| o How do I force a reload from the server/prevent caching?
|
| • Debugging
| o How do I get my browser to report javascript errors?
|
|
| • Things not to attempt in a browser
| o How can I prevent access to a web page by using javascript?
| o How do I protect my javascript code?
| o How can I access the client-side filesystem?
| o I have <a href="javascript:somefunction()"> what ... ?
|
|
`-------------------------------------------------------------------------/

?

The server side is inflexible to creating subcategories. The XML would
have to change and so would the two scripts for processing (it used to
be three, but I refactored that). It would probably also mess up Bart's
daily posts.

So, in the interest of getting it done, I want a hierarchy no deeper
than two.

Garrett
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Ah, but what is ordinary?

Approximately, those that one calls into existence with JavaScript
rather than those that are properties of the original document plus
added HTML things.


What do you think of:

,--------------------------------------------------------------------
|
| • Meta-FAQ meta-questions
| * Which newsgroups deal with javascript?
| * What questions are on-topic for CLJ?
| * What should I do before posting to CLJ?
| * Why was my post not answered?
| * Why do some posts have <FAQENTRY> in them?
| * How do I make a suggestion?
|
| • Javascript Tips
"Tips" seems wrong there. "About Scripting"??
| o What is ECMAScript?
| o What is JScript?
| o What are object models?
| o What is the document object model?
| o Internationalisation and Multinationalisation in javascript.
| o Where are the CLJ archives located?
To previous section ?
| o What does the future hold for ECMAScript?
|
| • Javascript Resources
| o What books cover javascript?
| o What online resources are available?
|
| • Dates
| o How do I format the lastModified date with javascript?
| • Numbers
| o How do I convert a Number into a String with exactly 2 decimal
| places?
| o Why does simple decimal arithmetic give strange results?
| o Why does K = parseInt('09') set K to 0?
| o Why does 1+1 equal 11? or How do I convert a string to a number?
| o How do I generate a random integer from 1 to N?
| • Objects
| o When should I use eval?
| o How do I access a property of an object using a string?
| • Strings and RegExps
| o How do I trim whitespace?
|
| • DOM and Forms
| o How do I get the value of a form control?
| o My element is named myselect[], how do I access it?
| o Why doesn't the global variable "divId" always refer to the
| element with id="divId"?
| o Why are my rollovers so slow?
| o How do I disable the right mouse button?
| o How do I detect Opera/Netscape/IE?
| o How do I modify the content of the current page?
| o How can I see in javascript if a web browser accepts cookies?
|
| • Windows and Frames
| o How do I communicate between frames in a web browser?
| o Why does framename.print() not print the correct frame in IE?
| o How do I change print settings with window.print()? for
| o I have window.status="Moomin"; why doesn't the statusbar
| change?
| o How can I disable the back button in a web browser?
| o How do I find the size of the window?
| o How do I change the text in the url/location bar?
| o How do I POST a form to a new window?
| o How do I change the confirm box to say yes/no or default to
| cancel?
| o Why do I get permission denied when accessing a frame/window?
| o How do I modify the content of the current page?
| o How do I prompt a "Save As" dialog for an accepted mime type?
| o How do I open a new window with javascript?
| o How do I check to see if a child window is open, before opening
| another?
| o How do I close a window and why does it not work on the first
| one?
| o How do I make a 10 second delay?
|
| • Ajax
I *think* we had some of these answers before Ajax was known.
Therefore, if so, the above heading should be more generic.
| o What is Ajax?
| o Why is my Ajax page not updated properly when using an HTTP GET
| request in Internet Explorer?
| o How do I download a page to a variable?
| o How do I get a perl/asp/php variable into client-side
| javascript?
| o How do I log-out a user when they leave my site?
| o How do I run a server side script?
| o How do I force a reload from the server/prevent caching?
|
| • Debugging
| o How do I get my browser to report javascript errors? o Debugging Tips [1]
|
|
| • Things not to attempt in a browser
| o How can I prevent access to a web page by using javascript? [2]
| o How do I protect my javascript code? [2]
| o How can I access the client-side filesystem?
| o I have <a href="javascript:somefunction()"> what ... ?
|
|
`-------------------------------------------------------------------------/

Otherwise OK. With anchors having names, parts can be moved at any
time. (Keep the numbers, for brief short-term reference in CLJ.)

[1] (condensed) : Test in small increments. Test locally, before
uploading. Verify presumptions. View intermediate results. Test with
many values. Check extreme cases and end-points. N.B. Debuggers report
where the existence of an error is detected, which is not necessarily
where the mistake is.

[2] : I disagree from the usual answer. If a script can be executed in
an Internet Browser, some people can read it. But many cannot read it -
those who know only Right Click, View Source can be utterly defeated by
breaking that operation. Many who want to protect their code do so
because they want to deter their idle and obtuse classmates from copying
it; the protection needs to be literally fool-proof, but not wise-proof.
 
D

dhtml

Dr said:
Approximately, those that one calls into existence with JavaScript
rather than those that are properties of the original document plus
added HTML things.



"Tips" seems wrong there. "About Scripting"??

How about "Language Overview" ?
To previous section ?

Yes.




Sure.


I *think* we had some of these answers before Ajax was known.
Therefore, if so, the above heading should be more generic.

Client/Server Communication?

Might be some crossover with the "Forms" questions.
| o What is Ajax?
| o Why is my Ajax page not updated properly when using an HTTP GET
| request in Internet Explorer?
| o How do I download a page to a variable?
| o How do I get a perl/asp/php variable into client-side
| javascript?
| o How do I log-out a user when they leave my site?
| o How do I run a server side script?
| o How do I force a reload from the server/prevent caching?
|
| • Debugging
| o How do I get my browser to report javascript errors? o Debugging Tips [1]
|
|
| • Things not to attempt in a browser
| o How can I prevent access to a web page by using javascript? [2]
| o How do I protect my javascript code? [2]
| o How can I access the client-side filesystem?
| o I have <a href="javascript:somefunction()"> what ... ?
|
|
`-------------------------------------------------------------------------/

Otherwise OK. With anchors having names, parts can be moved at any
time. (Keep the numbers, for brief short-term reference in CLJ.)

The numbers are generated in a loop. If I keep them in the loop, the
user will end up in the wrong place on the page. I can move them out of
the loop and hard code them into the xml, like:

<CONTENT ID="parseInt" NUMID="FAQ4_7">,


- then the page and the Mon/Wen mailings will look like:

5.9 Why does framename.print() not print the correct frame in IE?
5.30 I have window.status="Moomin"; why doesn't the statusbar change?
5.6 How do I communicate between frames in a web browser?

I find that to be a very confusing presentation.

It would be much better to not display numbers on the page then to
display them out of order.

So, will add the NUMID to the xml CONTENT elements and render that as an
empty link:

<a name="FAQ4_7"></a>

For the Mon/Wen posting, the number will not be shown and nothing will
replace it. We've been with numbers for a long long time. It's time to
say goodbye to them.

I will use the old version of the index page, restoring the links in the
archives that point to updated questions.

The text of each question in the TOC will be linked to the answer.

If it is difficult to read with the underline, I can use CSS to change
the appearance (blue, bold, perhaps, with underline on :hover).

Alternatively, I could use a way to display the answer below the
question, by toggling it.

+ What is blah blah ?


- What is blah blah ?
/answer:/
Lorem blah does not work with mork. To fix this, you should
instead use blah blah blah...

[1] (condensed) : Test in small increments. Test locally, before
uploading. Verify presumptions. View intermediate results. Test with
many values. Check extreme cases and end-points. N.B. Debuggers report
where the existence of an error is detected, which is not necessarily
where the mistake is.

I think more complete advice on unit testing would be a lot better.
[2] : I disagree from the usual answer. If a script can be executed in
an Internet Browser, some people can read it. But many cannot read it -
those who know only Right Click, View Source can be utterly defeated by
breaking that operation. Many who want to protect their code do so
because they want to deter their idle and obtuse classmates from copying
it; the protection needs to be literally fool-proof, but not wise-proof.

Those who only know right click would seem so clueless as to be totally
harmless. I don't think its worth adding that at all.

The worst Q/A pair I've found is the "what are object models (OMs)?" A
question such as "What is a Host object?" or "Is the DOM part of
ECMAScript?" could much better address discussion of Host objects than
the current "OMs" question.

For now, I have to go through the XML file and add the NUMID attribute
so that it exactly matches the one of the TOC before I changed it.

I do not intend to change the current fragment identifiers. Although
there may be better IDs, there are already links to them. Changing them
doesn't seem to offer that much benefit.

Garrett
 
D

Dr J R Stockton

In comp.lang.javascript message said:
How about "Language Overview" ?

Or just "Overview" to avoid quibbling as to whether all entries are
about languages.


The numbers are generated in a loop. If I keep them in the loop, the
user will end up in the wrong place on the page. I can move them out of
the loop and hard code them into the xml, like:

Keep the customary sequential numbering system. In the HTML tags, use
named anchors for machines. In the HTML and News text, use visible
numbers for people.



If it is difficult to read with the underline, I can use CSS to change
the appearance (blue, bold, perhaps, with underline on :hover).

No; remove all link appearance manipulation from the CSS. Default is
easier for all.



[1] (condensed) : Test in small increments. Test locally, before
uploading. Verify presumptions. View intermediate results. Test with
many values. Check extreme cases and end-points. N.B. Debuggers report
where the existence of an error is detected, which is not necessarily
where the mistake is.

I think more complete advice on unit testing would be a lot better.

Not in the FAQ, for reason of size.




Suggestion : in "3.2 What online resources are available?" add a new
sub-section "FAQ Notes", start it with the existing FAQ material about
the Notes (changing the last paragraph of Section 1 to "There are _FAQ
Notes_." linking to the new sub-section, and append a list of FAQ Note
Subjects each linking to its Note. Then simplify the migrated waffle.
 
D

dhtml

Dr said:
Or just "Overview" to avoid quibbling as to whether all entries are
about languages.




Keep the customary sequential numbering system. In the HTML tags, use
named anchors for machines. In the HTML and News text, use visible
numbers for people.

There's discussion in the archive of section 2.3. If FAQ has section 2.3
being totally different it is confusing.

The numbers are meaningless. How can they change without resulting in
total confusion?

For example:

User reads text about Same Origin Policy with link to:
/faq/index.html#FAQ4_8

This loads the page at:
5.3 How do I communicate between frames in a web browser?

Does that seem strange?

Compare:

http://jibbering.com/faq/index.html
http://jibbering.com/faq/indextest.html

I think the second one looks bad with that style of CSS.
If it is difficult to read with the underline, I can use CSS to change
the appearance (blue, bold, perhaps, with underline on :hover).

No; remove all link appearance manipulation from the CSS. Default is
easier for all.



[1] (condensed) : Test in small increments. Test locally, before
uploading. Verify presumptions. View intermediate results. Test with
many values. Check extreme cases and end-points. N.B. Debuggers report
where the existence of an error is detected, which is not necessarily
where the mistake is.
I think more complete advice on unit testing would be a lot better.

Not in the FAQ, for reason of size.

What you described is good advice, but doesn't describe what unit
testing is or how to do it.

I see many teams where they test the Java code, then, for the
javascript, the F/E team does nothing; they do not know how to unit test
their scripts. The code becomes unmanageable.

So, I'm not putting that up there.

Good general advice on testing:
http://blog.objectmentor.com/articles/2007/10/20/architecture-is-a-second-order-effect

But that does not explain how to test.

Garrett
 
B

Bart Van der Donck

dhtml said:
The numbers are meaningless. How can they change without resulting in
total confusion?

For example:>
User reads text about Same Origin Policy with link to:
/faq/index.html#FAQ4_8

This loads the page at:
5.3 How do I communicate between frames in a web browser?

Does that seem strange?

Yes, but this is an internal kitchen that stands apart from Usenet.
I'ld like to mention that the program that daily sends out a FAQ
entry, uses its internal couning mechanism (chapters/numbers)
according to the structure of the XML file only:

<FAQ>
<TITLE>comp.lang.javascript FAQ</TITLE>
<CONTENTS>
<CONTENT TITLE="chapter name">
<CONTENT TITLE="entry title">
text with <additional> </tags> in it
</CONTENT>
...more entries in the same chapter...
</CONTENT>
...more chapters with their entries...
</CONTENTS>
</FAQ>

The reason is of sheer technical nature; the program must store the
sent entry in order to know which will be the entry for the next day.
This is the logic:

(1) If a next entry exists within the same chapter, then send it and
quit.
(2) If (1) fails: take the first entry of the next chapter, send it
and quit (except the entries of the last chapter, as requested by Dr J
R Stockton, those are never sent because not relevant towards Usenet)
(3) If (2) fails: start over from the beginning, send first entry in
first chapter.
(4) If (3) fails: quit with error.
 
D

Dr J R Stockton

There's discussion in the archive of section 2.3. If FAQ has section 2.3
being totally different it is confusing.

The numbers are meaningless. How can they change without resulting in
total confusion?

For example:

User reads text about Same Origin Policy with link to:
/faq/index.html#FAQ4_8

This loads the page at:
5.3 How do I communicate between frames in a web browser?

Does that seem strange?

We cannot be bound by the details of the old numbering of sections.
IIRC, I suggested, when it was first evident that you were going to
tackle FAQ rearrangenent, that the file at http://jibbering.com/faq/index.html
should be as it were when Randy abandoned it [*], with the group
having a new FAQ (atarting with your current best) at a new URL.
[*] But add a luridly-boxed note about and link to the new FAQ.

I doubt whether many read the archives and then try to cross-refer to
the FAQ; if they must, they should use the Wayback Machine to refer to
an approximately contemporaneous FAQ.


What you described is good advice, but doesn't describe what unit
testing is or how to do it.

N.B. What I described wasn't expected to be omission-free.

That's because (at least) I don't know what you mean by "unit
testing"; and I expect that many of the intended FAQ audience will not
know either.
 
D

dhtml

Dr said:
We cannot be bound by the details of the old numbering of sections.

What benefit does numbering have?

It isn't as if section 1 must be read completely before beginning to
read section 2.


In such a document, "Numbers" has meaning. "4" does not.

IIRC, I suggested, when it was first evident that you were going to
tackle FAQ rearrangenent, that the file at http://jibbering.com/faq/index.html
should be as it were when Randy abandoned it [*], with the group

Yes, you did.
having a new FAQ (atarting with your current best) at a new URL.
[*] But add a luridly-boxed note about and link to the new FAQ.

I doubt whether many read the archives and then try to cross-refer to
the FAQ; if they must, they should use the Wayback Machine to refer to
an approximately contemporaneous FAQ.

We still have the problem of changing. When a hypothetical future
section 5 gets split to two sections, we have to renumber. Doing this
creates confusion.

What benefit do numbers add?

N.B. What I described wasn't expected to be omission-free.

That's because (at least) I don't know what you mean by "unit
testing"; and I expect that many of the intended FAQ audience will not
know either.

Unit testing javascript is excellent topic for discussion here.

(runs out to work)...

Garrett
 
D

Dr J R Stockton

In comp.lang.javascript message said:
What benefit do numbers add?

The numbers should only be *used* when reading a single "issue". If the
index leads a reader to think that he's like to look at sections 2.1,
3.3, and 4.7 next, he can find them by scrolling without going back at
the clickable list at the top or bottom - and in News, the list is not
clickable.

Numbers for short-term human use, word-anchors for long-term or machine
use.

You *could* add a note "Section numbering is sequential and
hierarchical, but the sections may change order from time to time", but
it should not be needed.

ISTR word processing software in which an equivalent of <ol> <li> could
be used to number headings, and an Indexer would produce an index
including whatever those numbers happened to be at that moment.
 
D

dhtml

Dr said:
The numbers should only be *used* when reading a single "issue". If the
index leads a reader to think that he's like to look at sections 2.1,
3.3, and 4.7 next, he can find them by scrolling without going back at
the clickable list at the top or bottom - and in News, the list is not
clickable.

It seems easier to main text that mentions a particular section. Than to
tell the reader to read section 2.1 and make sure that means the latest
section represented by the number 2.1 not a section that previously had
that number.
Numbers for short-term human use, word-anchors for long-term or machine
use.

For humans, it seems to me that a heading "Numbers" or "Forms" has more
relevant meaning than a number "4" or "5" for short, or long term use.
Numbers would seem useful if order mattered.

In the 'news' messages, it the question can be displayed with the
relevant header.

A question appears as a TITLE attribute for a CONTENT element. Its
header is always that CONTENT's parentNode's TITLE, so:

var q = node.attributes.getNamedItem('TITLE'),
section = node.parentNode.attributes.getNamedItem('TITLE');


If outputting one question is desired, and it is required that the
relevant header preceed the question, the code would look like:-

output += "*" + section + "*\n"
+ q;

You *could* add a note "Section numbering is sequential and
hierarchical, but the sections may change order from time to time", but
it should not be needed.

someone arriving at index.html#FAQ3_5 is not going to see that note,
unless the note exists right before #FAQ3_5, in which case, someone
arriving at index.html#4_11 is not going to see it.
ISTR word processing software in which an equivalent of <ol> <li> could
be used to number headings, and an Indexer would produce an index
including whatever those numbers happened to be at that moment.

The headings are currently numbered. It's done in a for loop. It could
also be done using an OL.
 
S

sasuke

Breaking up the FAQ has been discussed.

http://groups.google.com/group/comp.lang.javascript/browse_frm/thread...

I'm interested in doing this now. I propose something along the lines of:

* Numbers
* Windows and Frames
* Forms

I would like to hear feedback on this proposal.

The FAQ presents little [no?] information about `encoding' related
issues which do get asked frequently here. Many of them are along the
lines of:
- escape / unescape functions don't work well for Non-ASCII character
- encodeURIComponent to be used for encoding URI components rather
than encodeURI
- Setting the HTTP Request Header `Content-Type: x-www-
formurlencoded' when making asynchronous requests doesn't
automagically encode the data being submitted.

These are some of the points which have come across in this group in
the past few days related to encoding. It would be nice to have
someone come up with a short FAQ entry related to this topic.

/sasuke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top