Re: With clause syntax errors but how do I fix it? (correction)
JRS: In article <bj02q2$bi1$1@n ews.eusc.inter. net>, seen in
news:comp.lang. javascript, DU <drunclear@hotR EMOVEmail.com> posted at
Mon, 1 Sep 2003 14:23:00 :-[color=blue]
>
>Finally, please avoid top-posting in this newsgroup.[/color]
The term "top-posting" should not be used to a newcomer, since it will
not be understood by the average innocent top-poster.
Something like "responses should follow trimmed quotes" does not take
much longer to type.
Alternatively, if "top-posting" is used, the term should be defined in
the FAQ, and "; see FAQ" added. Plus, preferably, a link to the FAQ.
IMHO, javascript 'with' is a useful tool which can readily be misused.
IMHO, it can be good to use it when anyone reading the code for the
first time will, having not noticed the 'with', be able to deduce it.
with (document) {
write('This<br> ')
write(That, [them])
}
with (MyDate)
document.write( getFullYear()+'/'+LZ(getMonth() +1)+
'/'+LZ(getDate()) )
Where the contents of the with parentheses would be lengthy, the
alternative of using an auxiliary variable is that a new variable,
probably terse, will remain in scope until the end of the block; a human
author might reuse it without remembering to give it a new value.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
JRS: In article <bj02q2$bi1$1@n ews.eusc.inter. net>, seen in
news:comp.lang. javascript, DU <drunclear@hotR EMOVEmail.com> posted at
Mon, 1 Sep 2003 14:23:00 :-[color=blue]
>
>Finally, please avoid top-posting in this newsgroup.[/color]
The term "top-posting" should not be used to a newcomer, since it will
not be understood by the average innocent top-poster.
Something like "responses should follow trimmed quotes" does not take
much longer to type.
Alternatively, if "top-posting" is used, the term should be defined in
the FAQ, and "; see FAQ" added. Plus, preferably, a link to the FAQ.
IMHO, javascript 'with' is a useful tool which can readily be misused.
IMHO, it can be good to use it when anyone reading the code for the
first time will, having not noticed the 'with', be able to deduce it.
with (document) {
write('This<br> ')
write(That, [them])
}
with (MyDate)
document.write( getFullYear()+'/'+LZ(getMonth() +1)+
'/'+LZ(getDate()) )
Where the contents of the with parentheses would be lengthy, the
alternative of using an auxiliary variable is that a new variable,
probably terse, will remain in scope until the end of the block; a human
author might reuse it without remembering to give it a new value.
--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Comment