Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14888 > unrolled thread

An aid for text site developers

Started byDr J R Stockton <reply1227@merlyn.demon.co.uk.not.invalid>
First post2012-07-05 18:44 +0100
Last post2012-07-09 09:56 +0100
Articles 10 — 7 participants

Back to article view | Back to comp.lang.javascript


Contents

  An aid for text site developers Dr J R Stockton <reply1227@merlyn.demon.co.uk.not.invalid> - 2012-07-05 18:44 +0100
    Re: An aid for text site developers "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-07-06 07:20 +0000
      Re: An aid for text site developers Gene Wirchenko <genew@ocis.net> - 2012-07-06 10:38 -0700
        Re: An aid for text site developers Tim Streater <timstreater@greenbee.net> - 2012-07-06 18:44 +0100
          Re: An aid for text site developers Gene Wirchenko <genew@ocis.net> - 2012-07-06 13:26 -0700
            Re: An aid for text site developers Tim Streater <timstreater@greenbee.net> - 2012-07-06 22:33 +0100
              Re: An aid for text site developers Gene Wirchenko <genew@ocis.net> - 2012-07-07 21:25 -0700
                Re: An aid for text site developers "Qu0ll" <Qu0llSixFour@gmail.com> - 2012-07-08 14:43 +1000
                  Re: An aid for text site developers Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-07-08 20:03 +0200
                    Re: An aid for text site developers John G Harris <john@nospam.demon.co.uk> - 2012-07-09 09:56 +0100

#14888 — An aid for text site developers

FromDr J R Stockton <reply1227@merlyn.demon.co.uk.not.invalid>
Date2012-07-05 18:44 +0100
SubjectAn aid for text site developers
Message-ID<oc3lOnMQKd9PFw7R@invalid.uk.co.demon.merlyn.invalid>
This is a simple piece of code which many of you could have written and
tested in five minutes.  But you may not all have thought of doing so.


In the common include file, or in an include file present on the editing
system but not on the public server :-

        function Hooks() { var DAJ, T, J = document.anchors.length
          while (J--) { DAJ = document.anchors[J] ;
            if (T=DAJ.name) DAJ.title = "#" + T } }


In each texty linky anchory page :

        <BODY onload="Hooks()">
or      <BODY onload="if (Hooks) Hooks()">

Now, if you think while reading page A and editing page B  : "I should
link from somewhere in page A to the heading anchor there in page B -
what is it called?", just hover over the heading in B.  Comment?

The 'if' part is perhaps not needed; and, with little more effort, one
could show IDs similarly.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

[toc] | [next] | [standalone]


#14895

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2012-07-06 07:20 +0000
Message-ID<XnsA0885F1BECB0eejj99@194.109.133.133>
In reply to#14888
Dr J R Stockton wrote on 05 jul 2012 in comp.lang.javascript:

> In each texty linky anchory page :
> 
>         <BODY onload="Hooks()">

In Chrome, such nonexisting onload is simply ignored,
so testing is superfluous.

> or      <BODY onload="if (Hooks) Hooks()">

Fish should do:
"if (!hooks) byte()"

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#14910

FromGene Wirchenko <genew@ocis.net>
Date2012-07-06 10:38 -0700
Message-ID<oe8ev711k8tla1alhhg99vdl9o03oo2dta@4ax.com>
In reply to#14895
On 06 Jul 2012 07:20:59 GMT, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>Dr J R Stockton wrote on 05 jul 2012 in comp.lang.javascript:
>
>> In each texty linky anchory page :
>> 
>>         <BODY onload="Hooks()">
>
>In Chrome, such nonexisting onload is simply ignored,
>so testing is superfluous.

     Not superfluous.  Firefox 13.0.1 ignores the error as well, but
IE 9.0.8122.16421 does not.

     I would rather have the error thrown.  If I accidentally entered
the onload as "Hoks()", I would want to see an error right away.  The
alternative is wondering why some code (quite probably elsewhere on
the page) is not working.

>> or      <BODY onload="if (Hooks) Hooks()">
>
>Fish should do:
>"if (!hooks) byte()"

     Only digital fish.  Analog fish should still bite.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#14911

FromTim Streater <timstreater@greenbee.net>
Date2012-07-06 18:44 +0100
Message-ID<timstreater-FDCE1F.18442906072012@news.individual.net>
In reply to#14910
In article <oe8ev711k8tla1alhhg99vdl9o03oo2dta@4ax.com>,
 Gene Wirchenko <genew@ocis.net> wrote:

> On 06 Jul 2012 07:20:59 GMT, "Evertjan."
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
> >Dr J R Stockton wrote on 05 jul 2012 in comp.lang.javascript:
> >
> >> In each texty linky anchory page :
> >> 
> >>         <BODY onload="Hooks()">
> >
> >In Chrome, such nonexisting onload is simply ignored,
> >so testing is superfluous.
> 
>      Not superfluous.  Firefox 13.0.1 ignores the error as well, but
> IE 9.0.8122.16421 does not.
> 
>      I would rather have the error thrown.  If I accidentally entered
> the onload as "Hoks()", I would want to see an error right away.  The
> alternative is wondering why some code (quite probably elsewhere on
> the page) is not working.

Then you'd look in the Error Console where it would tell you that 
function Hoks does not exist and at which line the error occurred. Even 
if you don't get the line number a simple global search of your source 
will give it  to you.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#14914

FromGene Wirchenko <genew@ocis.net>
Date2012-07-06 13:26 -0700
Message-ID<3thev7tfef0d40bnv0tp3verpvm1skuhrc@4ax.com>
In reply to#14911
On Fri, 06 Jul 2012 18:44:29 +0100, Tim Streater
<timstreater@greenbee.net> wrote:

[snip]

>Then you'd look in the Error Console where it would tell you that 
>function Hoks does not exist and at which line the error occurred. Even 
>if you don't get the line number a simple global search of your source 
>will give it  to you.

     With Firefox, if Firebug is not active when the error occurs, I
have to rerun to get the error.

     It is much easier when the system detects an error for it to give
me the error message instead of me having to hunt for it.  Given an
error, it might not be computer-detectable.  Why should I have to
check every time for this when the system can do it for me?

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#14917

FromTim Streater <timstreater@greenbee.net>
Date2012-07-06 22:33 +0100
Message-ID<timstreater-A2185A.22333106072012@news.individual.net>
In reply to#14914
In article <3thev7tfef0d40bnv0tp3verpvm1skuhrc@4ax.com>,
 Gene Wirchenko <genew@ocis.net> wrote:

> On Fri, 06 Jul 2012 18:44:29 +0100, Tim Streater
> <timstreater@greenbee.net> wrote:
> 
> [snip]
> 
> >Then you'd look in the Error Console where it would tell you that 
> >function Hoks does not exist and at which line the error occurred. Even 
> >if you don't get the line number a simple global search of your source 
> >will give it  to you.
> 
>      With Firefox, if Firebug is not active when the error occurs, I
> have to rerun to get the error.

I use Safari. With the Develop menu enabled the Error Console is always 
available, and if its window was not up when I did the testing, that 
doesn't matter: I just open the Error Console and the info is there 
anyway.

>      It is much easier when the system detects an error for it to give
> me the error message instead of me having to hunt for it.  Given an
> error, it might not be computer-detectable.  Why should I have to
> check every time for this when the system can do it for me?

Once you've made the Hoks error once why would you make it again? 
Correct it and that's that.

> Sincerely,
> 
> Gene Wirchenko

And would you like to give yourself a proper signature that others' 
newsreaders can recognise for what it is, then I'd not have to snip it 
each time - thanks.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#14955

FromGene Wirchenko <genew@ocis.net>
Date2012-07-07 21:25 -0700
Message-ID<3r2iv7h9c605ouga48fhk51rfu5ujfdl5m@4ax.com>
In reply to#14917
On Fri, 06 Jul 2012 22:33:31 +0100, Tim Streater
<timstreater@greenbee.net> wrote:

>In article <3thev7tfef0d40bnv0tp3verpvm1skuhrc@4ax.com>,
> Gene Wirchenko <genew@ocis.net> wrote:

[snip]

>>      With Firefox, if Firebug is not active when the error occurs, I
>> have to rerun to get the error.
>
>I use Safari. With the Develop menu enabled the Error Console is always 
>available, and if its window was not up when I did the testing, that 
>doesn't matter: I just open the Error Console and the info is there 
>anyway.

     I open up Firebug after an error, and there is nothing there.

>>      It is much easier when the system detects an error for it to give
>> me the error message instead of me having to hunt for it.  Given an
>> error, it might not be computer-detectable.  Why should I have to
>> check every time for this when the system can do it for me?
>
>Once you've made the Hoks error once why would you make it again? 
>Correct it and that's that.

     I am referring to errors in general.

[snip]

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#14956

From"Qu0ll" <Qu0llSixFour@gmail.com>
Date2012-07-08 14:43 +1000
Message-ID<79adnXe4CIOGjWTSnZ2dnUVZ_hydnZ2d@westnet.com.au>
In reply to#14955
"Gene Wirchenko"  wrote in message 
news:3r2iv7h9c605ouga48fhk51rfu5ujfdl5m@4ax.com...

>> And would you like to give yourself a proper signature that others'
>> newsreaders can recognise for what it is, then I'd not have to snip it
>> each time - thanks.
>
> [snip]
>
> Sincerely,
>
> Gene Wirchenko

I guess not.

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me] 

[toc] | [prev] | [next] | [standalone]


#14957

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-07-08 20:03 +0200
Message-ID<2453158.lJKiB1RUpR@PointedEars.de>
In reply to#14956
Qu0ll wrote:

> "Gene Wirchenko"  wrote in message
> news:3r2iv7h9c605ouga48fhk51rfu5ujfdl5m@4ax.com...

It's called attribution _line_, not attribution novel.

>>> And would you like to give yourself a proper signature that others'
>>> newsreaders can recognise for what it is, then I'd not have to snip it
>>> each time - thanks.
>>
>> [snip]
>>
>> Sincerely,
>>
>> Gene Wirchenko
> 
> I guess not.
> 
> --
  ^^
That is not a proper signature delimiter (it has to be dashDashSpace –
`-- '), which is probably due to your using Windows Live Mail, the successor 
to the failed simulation of a NetNews client that was/is Outlook Express.

> -Qu0ll (Rare, not extinct)

s/Qu0/Tro/?

> _________________________________________________
> Qu0llSixFour@gmail.com
> [Replace the "SixFour" with numbers to email me]

Requiring people to fix your address header fields in order to contact you 
is not appropriate behavior in Usenet either.

Pot, kettle, black.


Score adjusted

PointedEars
-- 
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
  -- Richard Cornford, comp.lang.javascript, 2011-11-14

[toc] | [prev] | [next] | [standalone]


#14966

FromJohn G Harris <john@nospam.demon.co.uk>
Date2012-07-09 09:56 +0100
Message-ID<N7kSBTCBzp+PFwF1@J.A830F0FF37FB96852AD08924D9443D28E23ED5CD>
In reply to#14957
On Sun, 8 Jul 2012 at 20:03:18, in comp.lang.javascript, Thomas
'PointedEars' Lahn wrote:
>Qu0ll wrote:
>
>> "Gene Wirchenko"  wrote in message
>> news:3r2iv7h9c605ouga48fhk51rfu5ujfdl5m@4ax.com...
>
>It's called attribution _line_, not attribution novel.
  <snip>

This is what RFC 5322 says :-

"2.2.3.  Long Header Fields

   Each header field is logically a single line of characters comprising
   the field name, the colon, and the field body.  For convenience
   however, and to deal with the 998/78 character limitations per line,
   the field body portion of a header field can be split into a
   multiple-line representation; this is called "folding".  The general
   rule is that wherever this specification allows for folding white
   space (not simply WSP characters), a CRLF may be inserted before any
   WSP."

So you're complaining about something that hasn't happened.

  John
-- 
John Harris

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web