With clause syntax errors but how do I fix it?

Discussion in 'Javascript' started by Phil Powell, Sep 1, 2003.

  1. Phil Powell

    Phil Powell Guest

    <script>
    <!--

    function isValidAlert() {
    for (var i = 0; i < document.alertForm.length; i++) {
    with (document.alertForm.elements) {
    if (.name == "text" || .name == "password" || .name == "textarea") {
    if (.value == "") {
    alert("Please enter a " + .name);
    focus();
    return false;
    }
    } else if (.name == "select-one") {
    if (.options[document.alertForm.elements.selectedIndex].value ==
    "") {
    alert("Please select a " + .name);
    return false;
    }
    }
    }
    }
    }

    //-->
    </script>

    I don't know the answer to this problem, I am getting syntax errors, and
    "with" does not search well on any Javascript tutorial. So this is my only
    option for help; can someone tell me what I did wrong?

    Thanx
    Phil
     
    Phil Powell, Sep 1, 2003
    #1
    1. Advertising

  2. Hi,

    Phil Powell wrote:

    > <script>
    > <!--
    >
    > function isValidAlert() {
    > for (var i = 0; i < document.alertForm.length; i++) {
    > with (document.alertForm.elements) {
    > if (.name == "text" || .name == "password" || .name == "textarea") {
    > if (.value == "") {
    > alert("Please enter a " + .name);
    > focus();
    > return false;
    > }
    > } else if (.name == "select-one") {
    > if (.options[document.alertForm.elements.selectedIndex].value ==
    > "") {
    > alert("Please select a " + .name);
    > return false;
    > }
    > }
    > }
    > }
    > }
    >
    > //-->
    > </script>
    >
    > I don't know the answer to this problem, I am getting syntax errors, and
    > "with" does not search well on any Javascript tutorial. So this is my only
    > option for help; can someone tell me what I did wrong?
    >
    > Thanx
    > Phil


    "with" works in VB, but as far as I know, it doesn't in JavaScript. It
    also doesn't in most current languages. Anyway, it makes the code
    unreadable, and all in all it is good practice to not use it.

    If you want to simplify long or complicated structures, you can always
    redeclare them:

    var myText = windowNumberOne.document.theNameOfTheForm.theNameOfTheText;

    myText.value = "Hello world";

    Laurent
    --
    Laurent Bugnion, GalaSoft
    Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, GalaSoft, Sep 1, 2003
    #2
    1. Advertising

  3. Re: With clause syntax errors but how do I fix it? (correction)

    Correction, I was wrong. See below.

    Laurent Bugnion, GalaSoft wrote:

    > Hi,
    >
    > Phil Powell wrote:
    >
    >> <script>
    >> <!--
    >>
    >> function isValidAlert() {
    >> for (var i = 0; i < document.alertForm.length; i++) {
    >> with (document.alertForm.elements) {
    >> if (.name == "text" || .name == "password" || .name == "textarea") {
    >> if (.value == "") {
    >> alert("Please enter a " + .name);
    >> focus();
    >> return false;
    >> }
    >> } else if (.name == "select-one") {
    >> if (.options[document.alertForm.elements.selectedIndex].value ==
    >> "") {
    >> alert("Please select a " + .name);
    >> return false;
    >> }
    >> }
    >> }
    >> }
    >> }
    >>
    >> //-->
    >> </script>
    >>
    >> I don't know the answer to this problem, I am getting syntax errors, and
    >> "with" does not search well on any Javascript tutorial. So this is my
    >> only
    >> option for help; can someone tell me what I did wrong?
    >>
    >> Thanx
    >> Phil

    >
    >
    > "with" works in VB, but as far as I know, it doesn't in JavaScript. It
    > also doesn't in most current languages. Anyway, it makes the code
    > unreadable, and all in all it is good practice to not use it.
    >
    > If you want to simplify long or complicated structures, you can always
    > redeclare them:
    >
    > var myText = windowNumberOne.document.theNameOfTheForm.theNameOfTheText;
    >
    > myText.value = "Hello world";
    >
    > Laurent


    OK, I was wrong. With exists in JavaScript, as described in this example:

    It is often convenient to use the with statement when a section of code
    uses several math constants and methods, so you don't have to type
    "Math" repeatedly. For example,

    with (Math) {
    a = PI * r*r
    y = r*sin(theta)
    x = r*cos(theta)
    }

    So the syntax is different (you don't use the '.' like in VB).

    I stand, however, by the fact that it's bad practice to use it, and I
    really recommend that you don't.

    HTH,

    Laurent
    --
    Laurent Bugnion, GalaSoft
    Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, GalaSoft, Sep 1, 2003
    #3
  4. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Wow, damned one way or another.. that is awful!

    I don't know what is more unreadable, how you view a "with" clause, or this:

    document.alertForm.elements.options[document.alertForm.elements.select
    edIndex].value

    I think that is utterly unreadable myself! I was trying to come up with an
    elegant and readable solution to parse through form elements for client-side
    validation. :(

    I remember you use "." in VB. Sorry but it's now

    VB 1
    Javascript 0

    That is very unsafe to not use "." because of potential data collision.

    Phil

    "Laurent Bugnion, GalaSoft" <galasoft-LB@bluewin_NO_SPAM.ch> wrote in
    message news:...
    > Correction, I was wrong. See below.
    >
    > Laurent Bugnion, GalaSoft wrote:
    >
    > > Hi,
    > >
    > > Phil Powell wrote:
    > >
    > >> <script>
    > >> <!--
    > >>
    > >> function isValidAlert() {
    > >> for (var i = 0; i < document.alertForm.length; i++) {
    > >> with (document.alertForm.elements) {
    > >> if (.name == "text" || .name == "password" || .name == "textarea")

    {
    > >> if (.value == "") {
    > >> alert("Please enter a " + .name);
    > >> focus();
    > >> return false;
    > >> }
    > >> } else if (.name == "select-one") {
    > >> if (.options[document.alertForm.elements.selectedIndex].value

    ==
    > >> "") {
    > >> alert("Please select a " + .name);
    > >> return false;
    > >> }
    > >> }
    > >> }
    > >> }
    > >> }
    > >>
    > >> //-->
    > >> </script>
    > >>
    > >> I don't know the answer to this problem, I am getting syntax errors,

    and
    > >> "with" does not search well on any Javascript tutorial. So this is my
    > >> only
    > >> option for help; can someone tell me what I did wrong?
    > >>
    > >> Thanx
    > >> Phil

    > >
    > >
    > > "with" works in VB, but as far as I know, it doesn't in JavaScript. It
    > > also doesn't in most current languages. Anyway, it makes the code
    > > unreadable, and all in all it is good practice to not use it.
    > >
    > > If you want to simplify long or complicated structures, you can always
    > > redeclare them:
    > >
    > > var myText = windowNumberOne.document.theNameOfTheForm.theNameOfTheText;
    > >
    > > myText.value = "Hello world";
    > >
    > > Laurent

    >
    > OK, I was wrong. With exists in JavaScript, as described in this example:
    >
    > It is often convenient to use the with statement when a section of code
    > uses several math constants and methods, so you don't have to type
    > "Math" repeatedly. For example,
    >
    > with (Math) {
    > a = PI * r*r
    > y = r*sin(theta)
    > x = r*cos(theta)
    > }
    >
    > So the syntax is different (you don't use the '.' like in VB).
    >
    > I stand, however, by the fact that it's bad practice to use it, and I
    > really recommend that you don't.
    >
    > HTH,
    >
    > Laurent
    > --
    > Laurent Bugnion, GalaSoft
    > Webdesign, Java, JavaScript: http://www.galasoft-LB.ch
    > Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    > Support children in Calcutta: http://www.calcutta-espoir.ch
    >
     
    Phil Powell, Sep 1, 2003
    #4
  5. Phil Powell

    DU Guest

    Phil Powell wrote:

    > <script>
    > <!--
    >
    > function isValidAlert() {
    > for (var i = 0; i < document.alertForm.length; i++) {
    > with (document.alertForm.elements)

    {
    > if (.name == "text" || .name == "password" || .name == "textarea") {


    This seems suspicious. I bet it would be rather:

    if (type == "text" || type == "password" || type == "textarea") {

    > if (.value == "")


    if(value == "")

    {
    > alert("Please enter a " + .name);
    > focus();
    > return false;
    > }
    > } else if (.name == "select-one") {
    > if (.options[document.alertForm.elements.selectedIndex].value ==
    > "") {
    > alert("Please select a " + .name);
    > return false;


    Remove "." everywhere and try to make your code more compact.

    > }
    > }
    > }
    > }
    > }
    >
    > //-->
    > </script>
    >
    > I don't know the answer to this problem, I am getting syntax errors, and
    > "with" does not search well on any Javascript tutorial. So this is my only
    > option for help; can someone tell me what I did wrong?
    >
    > Thanx
    > Phil
    >
    >


    It is widely known that with statements are very cpu-demanding, RAM
    demanding also and are best to be avoided. Even MSDN recommends this.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
     
    DU, Sep 1, 2003
    #5
  6. Phil Powell

    DU Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Phil Powell wrote:

    > Wow, damned one way or another.. that is awful!
    >
    > I don't know what is more unreadable, how you view a "with" clause, or this:
    >
    > document.alertForm.elements.options[document.alertForm.elements.select
    > edIndex].value
    >
    > I think that is utterly unreadable myself!


    Then just use a local variable to store each element (at the start of
    your for loop). E.g.:

    var IteratedFormElement = document.alertForm.elements;
    (...)

    if(IteratedFormElement.options[IteratedFormElement.selectedIndex].value
    == "")
    (...)

    I was trying to come up with an
    > elegant and readable solution to parse through form elements for client-side
    > validation. :(
    >


    [snipped]

    Finally, please avoid top-posting in this newsgroup. Top-posting
    destroys logical reading context and chronological order of posts in
    threads.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
     
    DU, Sep 1, 2003
    #6
  7. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    top-posting? HUH? English, please, or Svenska.

    Phil

    "DU" <> wrote in message
    news:bj02q2$bi1$...
    > Phil Powell wrote:
    >
    > > Wow, damned one way or another.. that is awful!
    > >
    > > I don't know what is more unreadable, how you view a "with" clause, or

    this:
    > >
    > >

    document.alertForm.elements.options[document.alertForm.elements.select
    > > edIndex].value
    > >
    > > I think that is utterly unreadable myself!

    >
    > Then just use a local variable to store each element (at the start of
    > your for loop). E.g.:
    >
    > var IteratedFormElement = document.alertForm.elements;
    > (...)
    >
    > if(IteratedFormElement.options[IteratedFormElement.selectedIndex].value
    > == "")
    > (...)
    >
    > I was trying to come up with an
    > > elegant and readable solution to parse through form elements for

    client-side
    > > validation. :(
    > >

    >
    > [snipped]
    >
    > Finally, please avoid top-posting in this newsgroup. Top-posting
    > destroys logical reading context and chronological order of posts in
    > threads.
    >
    > DU
    > --
    > Javascript and Browser bugs:
    > http://www10.brinkster.com/doctorunclear/
    > - Resources, help and tips for Netscape 7.x users and Composer
    > - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    > http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    >
     
    Phil Powell, Sep 1, 2003
    #7
  8. Re: With clause syntax errors but how do I fix it? (correction)

    Top-posting is putting your reply on top of the message or phrase you are
    replying to. As I'm doing now...

    "Phil Powell" <> schreef in bericht
    news:swM4b.92709$xf.26491@lakeread04...
    > top-posting? HUH? English, please, or Svenska.
    >


    -----------------

    "Phil Powell" <> schreef in bericht
    news:swM4b.92709$xf.26491@lakeread04...
    > top-posting? HUH? English, please, or Svenska.
    >


    This is the proper way of replying to a message by putting your reply
    beneath the message.


    JW
     
    Janwillem Borleffs, Sep 1, 2003
    #8
  9. Re: With clause syntax errors but how do I fix it? (correction)

    "Phil Powell" <> schreef in bericht
    news:AVL4b.92357$xf.24656@lakeread04...
    > I remember you use "." in VB. Sorry but it's now
    >
    > VB 1
    > Javascript 0
    >
    > That is very unsafe to not use "." because of potential data collision.
    >


    No, it's not, because the scope is limited to the with clause itself. Try
    the following example:

    <html>
    <head>
    <title> New Document </title>
    <script type="text/javascript">
    name = "Hello 1";

    function doAlert() {
    var name = "Hello 2";
    with (document.forms[0].elements[0]) {
    alert("Form element's name value: " + name);
    }
    alert("Global var name value: " + window['name']);
    alert("Local var name value: " + name);
    }
    </script>
    </head>

    <body>
    <form>
    <input type="text" value="text" name="test">
    <input type="button" onClick="doAlert()" value="Test">
    </form>
    </body>
    </html>

    BTW, I don't subscribe to Laurent's point of view regarding the with clause.


    JW
     
    Janwillem Borleffs, Sep 1, 2003
    #9
  10. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Ok, assuming that you have the with clause with your example. See my
    comments below.

    Phil

    "Janwillem Borleffs" <> wrote in message
    news:3f53b7aa$0$28887$...
    >
    > "Phil Powell" <> schreef in bericht
    > news:AVL4b.92357$xf.24656@lakeread04...
    > > I remember you use "." in VB. Sorry but it's now
    > >
    > > VB 1
    > > Javascript 0
    > >
    > > That is very unsafe to not use "." because of potential data collision.
    > >

    >
    > No, it's not, because the scope is limited to the with clause itself. Try
    > the following example:
    >
    > <html>
    > <head>
    > <title> New Document </title>
    > <script type="text/javascript">
    > name = "Hello 1";
    >
    > function doAlert() {
    > var name = "Hello 2";
    > with (document.forms[0].elements[0]) {
    > alert("Form element's name value: " + name);
    > }
    > alert("Global var name value: " + window['name']);
    > alert("Local var name value: " + name);
    > }
    > </script>


    Ok, now, what if you need both the var "name" AND
    document.forms[0].elements[0].name at the same time? You see, with
    Javascript not permitting the VB solution you can't do both so easily. VB
    you would have "name" and ".name".

    Phil

    > </head>
    >
    > <body>
    > <form>
    > <input type="text" value="text" name="test">
    > <input type="button" onClick="doAlert()" value="Test">
    > </form>
    > </body>
    > </html>
    >
    > BTW, I don't subscribe to Laurent's point of view regarding the with

    clause.
    >
    >
    > JW
    >
    >
    >
     
    Phil Powell, Sep 1, 2003
    #10
  11. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Maybe it's a comp.lang.javascript thing but I don't get it. What's wrong
    with that? That is the conventional reply. I'd never think to look below
    unless you direct me to look below for comments on a particular area; and I
    only do that when I need to highlight something you have said.

    I think DU's logic flow and mine are in different worlds.

    Phil

    "Janwillem Borleffs" <> wrote in message
    news:3f53b19e$0$28907$...
    > Top-posting is putting your reply on top of the message or phrase you are
    > replying to. As I'm doing now...
    >
    > "Phil Powell" <> schreef in bericht
    > news:swM4b.92709$xf.26491@lakeread04...
    > > top-posting? HUH? English, please, or Svenska.
    > >

    >
    > -----------------
    >
    > "Phil Powell" <> schreef in bericht
    > news:swM4b.92709$xf.26491@lakeread04...
    > > top-posting? HUH? English, please, or Svenska.
    > >

    >
    > This is the proper way of replying to a message by putting your reply
    > beneath the message.
    >
    >
    > JW
    >
    >
    >
     
    Phil Powell, Sep 1, 2003
    #11
  12. Re: With clause syntax errors but how do I fix it? (correction)

    "Phil Powell" <> schreef in bericht
    news:HMO4b.93315$xf.73424@lakeread04...
    >
    > Ok, now, what if you need both the var "name" AND
    > document.forms[0].elements[0].name at the same time? You see, with
    > Javascript not permitting the VB solution you can't do both so easily. VB
    > you would have "name" and ".name".
    >


    Yes it does, but you must define the variable as a property of the function:

    function doAlert() {
    with (document.forms[0].elements[0]) {
    alert("Form element's name value: " + name);
    alert("Local var name value: " + doAlert.name);
    }
    }

    doAlert.name = "Hello There";

    I admit, with VB the syntax is more convenient. But as you can see, there
    are ways of getting there with JavaScript too.

    In a way, it even forces you to think about your program design. E.g., when
    my script encounters a pre-defined property 'name', then I shouldn't define
    a variable with the same name. This is a good thing in my point of view.


    JW
     
    Janwillem Borleffs, Sep 1, 2003
    #12
  13. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Never mind, you lost me completely.

    Phil

    "DU" <> wrote in message
    news:bj0f2t$g4g$...
    >
    > http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    > - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    > - Resources, help and tips for Netscape 7.x users and Composer
    > http://www10.brinkster.com/doctorunclear/
    > Javascript and Browser bugs:
    > --
    > DU
    >
    >
    > top to bottom, not from bottom to top.
    > preferences then? Because 99.99% of people in this newsgroup read from
    > Are you saying that you read from bottom to top? What are your reading
    > >
    > > Phil
    > >
    > > I think DU's logic flow and mine are in different worlds.
    > >
    > > only do that when I need to highlight something you have said.
    > > unless you direct me to look below for comments on a particular area;

    > and I
    > > with that? That is the conventional reply. I'd never think to look

    below
    > > Maybe it's a comp.lang.javascript thing but I don't get it. What's

    wrong
    > Phil Powell wrote:
    >
    > [snipped]
    >
    >
    >
    >
    >
    >
    >
    >
     
    Phil Powell, Sep 1, 2003
    #13
  14. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    That is a Java/CF/PHP solution moreso than Javascript. It appears
    Javascript is becoming more like Java every day!!!

    I never knew you could do that!

    Phil

    "Janwillem Borleffs" <> wrote in message
    news:3f53c17d$0$28893$...
    >
    > "Phil Powell" <> schreef in bericht
    > news:HMO4b.93315$xf.73424@lakeread04...
    > >
    > > Ok, now, what if you need both the var "name" AND
    > > document.forms[0].elements[0].name at the same time? You see, with
    > > Javascript not permitting the VB solution you can't do both so easily.

    VB
    > > you would have "name" and ".name".
    > >

    >
    > Yes it does, but you must define the variable as a property of the

    function:
    >
    > function doAlert() {
    > with (document.forms[0].elements[0]) {
    > alert("Form element's name value: " + name);
    > alert("Local var name value: " + doAlert.name);
    > }
    > }
    >
    > doAlert.name = "Hello There";
    >
    > I admit, with VB the syntax is more convenient. But as you can see, there
    > are ways of getting there with JavaScript too.
    >
    > In a way, it even forces you to think about your program design. E.g.,

    when
    > my script encounters a pre-defined property 'name', then I shouldn't

    define
    > a variable with the same name. This is a good thing in my point of view.
    >
    >
    > JW
    >
    >
    >
     
    Phil Powell, Sep 1, 2003
    #14
  15. Phil Powell

    Jim Ley Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    On Mon, 1 Sep 2003 18:12:13 -0400, "Phil Powell" <>
    wrote:

    >That is a Java/CF/PHP solution moreso than Javascript. It appears
    >Javascript is becoming more like Java every day!!!


    Javascript hasn't changed in a number of years....

    >> function doAlert() {
    >> with (document.forms[0].elements[0]) {
    >> alert("Form element's name value: " + name);
    >> alert("Local var name value: " + doAlert.name);
    >> }
    >> }


    with is considerably slower to execute and best avoided entirely.

    Please learn how to post, it's not "top or bottom", it's snipped
    interleaved quoting, your lack of snipping is your biggest problem.

    Jim.
    --
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Jim Ley, Sep 2, 2003
    #15
  16. Re: With clause syntax errors but how do I fix it? (correction)

    JRS: In article <bj02q2$bi1$>, seen in
    news:comp.lang.javascript, DU <> posted at
    Mon, 1 Sep 2003 14:23:00 :-
    >
    >Finally, please avoid top-posting in this newsgroup.


    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.demon.co.uk/js-index.htm> JS maths, dates, sources.
    <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
     
    Dr John Stockton, Sep 2, 2003
    #16
  17. Re: With clause syntax errors but how do I fix it? (correction)

    > I don't know what is more unreadable, how you view a "with" clause, or this:
    >
    > document.alertForm.elements.options[document.alertForm.elements.select
    > edIndex].value
    >
    > I think that is utterly unreadable myself! I was trying to come up with an
    > elegant and readable solution to parse through form elements for client-side
    > validation. :(


    The with statement should be avoided. Use a var to do what you would do with
    with.

    var e = document.alertForm.elements;
    ... e.options[e.selectedIndex].value ...

    The var lets you be explicit, while the with can have surprising and seemingly
    random behavior. The appearance of with in the language was well intentioned,
    but it was a mistake and it should be removed.

    http://www.crockford.com/javascript/survey.html
     
    Douglas Crockford, Sep 2, 2003
    #17
  18. Phil Powell

    DU Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Dr John Stockton wrote:

    > JRS: In article <bj02q2$bi1$>, seen in
    > news:comp.lang.javascript, DU <> posted at
    > Mon, 1 Sep 2003 14:23:00 :-
    >
    >>Finally, please avoid top-posting in this newsgroup.

    >
    >
    > The term "top-posting" should not be used to a newcomer, since it will
    > not be understood by the average innocent top-poster.
    >


    How do you figure out who is a newcomer in a newsgroup? How can you
    reasonably do that?

    > 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.
    >
    >


    I'm all for defining "top-posting" in this newsgroup FAQ and I'm all for
    explaining why top-posting just makes reading posts, replies and threads
    harder for others.
    Top-posting is not the natural reading direction for 99.99% of users in
    this newsgroup... unless you really read from bottom to top (like
    ancient Chinese).
    Top-posting destroys chronological order of posts in threads.
    Top-posting destroys logical reading context.
    Top-posting makes others constantly scroll up and down to figure out
    what was said and then what was replied: there is no book, document,
    paper anywhere which goes like that. No one reads a book from end to
    start. No one reads an interview in a magazine by first reading the
    answers to questions. No one reads solutions first and then problem
    descriptions. I don't video-tape a movie from end to start.
    Top-posting generally makes it harder to understand message posts context.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
     
    DU, Sep 2, 2003
    #18
  19. Phil Powell

    Phil Powell Guest

    Re: With clause syntax errors but how do I fix it? (correction)

    Thanx for your help.

    "DU" <> wrote in message
    news:bj2jv8$aq1$...
    > Dr John Stockton wrote:
    >
    > > JRS: In article <bj02q2$bi1$>, seen in
    > > news:comp.lang.javascript, DU <> posted at
    > > Mon, 1 Sep 2003 14:23:00 :-
    > >
    > >>Finally, please avoid top-posting in this newsgroup.

    > >
    > >
    > > The term "top-posting" should not be used to a newcomer, since it will
    > > not be understood by the average innocent top-poster.
    > >

    >
    > How do you figure out who is a newcomer in a newsgroup? How can you
    > reasonably do that?
    >
    > > 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.
    > >
    > >

    >
    > I'm all for defining "top-posting" in this newsgroup FAQ and I'm all for
    > explaining why top-posting just makes reading posts, replies and threads
    > harder for others.
    > Top-posting is not the natural reading direction for 99.99% of users in
    > this newsgroup... unless you really read from bottom to top (like
    > ancient Chinese).
    > Top-posting destroys chronological order of posts in threads.
    > Top-posting destroys logical reading context.
    > Top-posting makes others constantly scroll up and down to figure out
    > what was said and then what was replied: there is no book, document,
    > paper anywhere which goes like that. No one reads a book from end to
    > start. No one reads an interview in a magazine by first reading the
    > answers to questions. No one reads solutions first and then problem
    > descriptions. I don't video-tape a movie from end to start.
    > Top-posting generally makes it harder to understand message posts context.
    >
    > DU
    > --
    > Javascript and Browser bugs:
    > http://www10.brinkster.com/doctorunclear/
    > - Resources, help and tips for Netscape 7.x users and Composer
    > - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    > http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
    >
     
    Phil Powell, Sep 2, 2003
    #19
  20. Re: With clause syntax errors but how do I fix it? (correction)

    "Douglas Crockford" <> writes:

    > The var lets you be explicit, while the with can have surprising and
    > seemingly random behavior.


    Can you give examples of deliberate use of "with" that has surpricing
    and seemingly random behavior?

    > The appearance of with in the language
    > was well intentioned, but it was a mistake and it should be removed.


    > http://www.crockford.com/javascript/survey.html


    (where all you say is "The with statement should be avoided" :))
    /L
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
     
    Lasse Reichstein Nielsen, Sep 2, 2003
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Abdel

    Syntax error in FROM clause

    Abdel, Jan 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,338
    Mike McIntyre
    Jan 10, 2004
  2. Xah Lee
    Replies:
    22
    Views:
    1,187
    Tim Roberts
    Mar 21, 2006
  3. Xah Lee
    Replies:
    23
    Views:
    1,133
    Tim Roberts
    Mar 21, 2006
  4. JB
    Replies:
    6
    Views:
    1,094
  5. Xah Lee
    Replies:
    21
    Views:
    853
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page