conditional compilation is turned off

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Québec

    #1

    conditional compilation is turned off

    Hi every body,

    What does that mean?
    The following script raises the subject alarm.

    <p><a href="javascrip t:void();"
    onClick="mailto :sgagnon@cyberu s.ca?Subject=BR ITTANY&nbsp;WOR KSHOP">

    <img align=left src="britany.gi f" width="231" height="40" border=0
    alt="BRITTANY WORKSHOP with Sylvio Gagnon" style="text-indent: .2em;
    background:ffff ff; color:bb5500;">
    </a></p>

    Jean Pierre Daviau


  • Lasse Reichstein Nielsen

    #2
    Re: conditional compilation is turned off

    "Québec" <jpda@vidn.ca > writes:
    [color=blue]
    > What does that mean?[/color]

    What? (I.e., don't put an essential part of your message in the subject,
    it is confuzing to readers).
    [color=blue]
    > The following script raises the subject alarm.[/color]
    [color=blue]
    > <p><a href="javascrip t:void();"
    > onClick="mailto :sgagnon@cyberu s.ca?Subject=BR ITTANY&nbsp;WOR KSHOP">[/color]

    Apart from using javscript:-URLs at all, which is recommended against,
    the href is syntactically incorrect Javascript. The "void" operator is
    not a function, it needs an expression after it.

    The onclick attribute value should contain javascript, but instead
    contains a mailto:-URL (also recommended against, at least don't rely on
    the user being able to use it).

    Conditional compilation is something IE uses with its scripting. I guess
    it is the "@" in the onclick attribute value that triggers the alert.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • VK

      #3
      Re: conditional compilation is turned off

      The interpereter expects a JavaScript code in the onClick handler.
      This mailto address looks like a uniline conditional assignement
      x=(condition)?y :z
      So it tries to process this assignement and eveidently falls miserably,
      this is the source of the error message.

      The right way is (you don't need any script here at all):
      <a href="mailto:sg agnon@cyberus.c a?subject=BRITT ANY%20WORKSHOP" >Send
      e-mail</a>

      It's very important to remember to URLEncode (escape) text for subject
      and body.
      In the particular all spaces have to be replaced by %20 and all line
      breaks by %0D%0A


      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: conditional compilation is turned off

        VK wrote:
        [color=blue]
        > The right way is (you don't need any script here at all):
        > <a href="mailto:sg agnon@cyberus.c a?subject=BRITT ANY%20WORKSHOP" >Send
        > e-mail</a>[/color]

        And it is to be noted that such hyperlinks depend on an e-mail client
        configured for the HTTP user agent that *understands* `mailto:' URIs,
        which excludes many visitors using only web interfaces for their e-mail.
        One should therefore use a feedback form utilizing a server-side formmailer
        application where possible. BTW, an easily configurable and (for
        non-commercial use) free formmailer that does not require CGI support
        for your webspace, can be found at http://formmailer.com/


        PointedEars

        Comment

        • VK

          #5
          Re: conditional compilation is turned off

          Mailto is an official protocol accepted and documented by 3W years and
          years ago.
          If some UserAgents still didn't implement it, it's their problem.
          ~97% did, and it's mighty good for Web.
          (Some browsers still cannot handle properly CSS, but it's not a reason
          to do not use styles at all).

          Yes, mailto has its defaults, the main is that it's easy to grab by
          spammers.

          Still it gives an opportunity to easy and quickly generate adjusted
          e-mail messages without learning server-side scripting, getting access
          to this scripting etc.
          It's a very helpful tool for beginners.


          Comment

          • Eric Bohlman

            #6
            Re: conditional compilation is turned off

            "VK" <schools_ring@y ahoo.com> wrote in
            news:3fad1437$0 $15664$9b622d9e @news.freenet.d e:
            [color=blue]
            > Mailto is an official protocol accepted and documented by 3W years and
            > years ago.
            > If some UserAgents still didn't implement it, it's their problem.
            > ~97% did, and it's mighty good for Web.
            > (Some browsers still cannot handle properly CSS, but it's not a reason
            > to do not use styles at all).[/color]

            You've missed the point. The big problem isn't that *browsers* don't
            understand it (the majority of them do), but that even if the browser
            understands it, it works only if the user's system has a *mail* user agent
            configured, which will *not* be the case if

            1) The user's email provider works by a purely Web interface rather than
            SMTP or

            2) The user is running on a shared-access machine such as a library
            terminal or a computer in an Internet cafe (there are entire countries
            where the latter is how the vast majority of Internet users access the
            net).

            Comment

            • HikksNotAtHome

              #7
              Re: conditional compilation is turned off

              In article <Xns942DC2464E5 38ebohlmanomsde vcom@130.133.1. 4>, Eric Bohlman
              <ebohlman@earth link.net> writes:

              <-snip->
              [color=blue]
              >You've missed the point. The big problem isn't that *browsers* don't
              >understand it (the majority of them do), but that even if the browser
              >understands it, it works only if the user's system has a *mail* user agent
              >configured, which will *not* be the case if
              >
              >1) The user's email provider works by a purely Web interface rather than
              >SMTP or
              >
              >2) The user is running on a shared-access machine such as a library
              >terminal or a computer in an Internet cafe (there are entire countries
              >where the latter is how the vast majority of Internet users access the
              >net).
              >[/color]

              And a 3rd case:

              3) The user has a browser that does not have an email program associated to
              handle mailto: Of the 17 or so browsers that I have, only one (the AOL
              browser), has an email program associated with it. Any other browser, it
              prompts me to install its self-associated email program (which I never do - I
              have an email program of choice) so that the authors unreliable mailto: works
              for the page.
              --
              Randy

              Comment

              • Québec

                #8
                Re: conditional compilation is turned off

                [preceding]
                YES
                so I added by pressing this button or by writing to: sgagnon@cyberus .ca
                =============== =
                If I write
                alert((a == sgagnon@cyberus .ca)?'subject':'BR ITTANY WORKSHOP');

                I get conditionnal compilation is turned off

                If I write without the @
                alert((a == sgagnoncyberus. ca)?'subject':' BRITTANY WORKSHOP');

                I get sgagnoncyberus. ca is undefined

                alert((a == 'sgagnoncyberus .ca' )?'subject':'BR ITTANY WORKSHOP');


                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: conditional compilation is turned off

                  Québec wrote:
                  [color=blue]
                  > [preceding]
                  > YES[/color]

                  ?

                  <http://www.netmeister. org/news/learn2quote.htm l>
                  [color=blue]
                  > so I added by pressing this button or by writing to: sgagnon@cyberus .ca[/color]

                  ?
                  [color=blue]
                  > =============== =
                  > If I write
                  > alert((a == sgagnon@cyberus .ca)?'subject':'BR ITTANY WORKSHOP');[/color]
                  ^[1] ^^^^^^^^^^^^^^^ ^^^[2]

                  [1] What is `a'?

                  [2] The mail address must be a string literal,
                  enclose it in single or double quotes.

                  [3] What should the above code achieve?
                  [color=blue]
                  > I get conditionnal compilation is turned off[/color]

                  http://msdn.microsoft.com/library/de...statements.asp
                  [color=blue]
                  > If I write without the @[/color]

                  The `@' is not the point, the type of the operand of `==' is.
                  [color=blue]
                  > alert((a == sgagnoncyberus. ca)?'subject':' BRITTANY WORKSHOP');
                  >
                  > I get sgagnoncyberus. ca is undefined[/color]

                  Of course, see [2].
                  [color=blue]
                  > alert((a == 'sgagnoncyberus .ca' )?'subject':'BR ITTANY WORKSHOP');[/color]

                  FWIW, that is at least syntactically correct and you can re-include
                  the `@' here.

                  BTW, I doubt that you have fully understood what was written about
                  the use of `mailto:'.


                  PointedEars

                  Comment

                  • Québec

                    #10
                    Re: conditional compilation is turned off

                    > Québec wrote:[color=blue][color=green]
                    > > [preceding]
                    > > YES[/color][/color]
                    I say ok to what was written about browsers in the thread.

                    [color=blue]
                    > If I write
                    > alert((a == sgagnon@cyberus .ca)?'subject':'BR ITTANY WORKSHOP');
                    >
                    > I get conditionnal compilation is turned off
                    >
                    > If I write without the @
                    > alert((a == sgagnoncyberus. ca)?'subject':' BRITTANY WORKSHOP');
                    >
                    > I get sgagnoncyberus. ca is undefined[/color]
                    The var a = ""
                    I know I should have quoted the address.
                    So. The @ is what turns on the "conditionn al compilation is turned off"
                    [color=blue]
                    >http://msdn.microsoft.com/library/de...-us/jscript7/h[/color]
                    tml/jsconconditiona lcompilationsta tements.asp
                    Aren't we on a javascript newsgroup?

                    I am sure I mixed you up a bit more. It is a bad talent I have to mix up
                    everybody and especially myself. :-)


                    Thank you very much.


                    Comment

                    • Thomas 'PointedEars' Lahn

                      #11
                      Re: conditional compilation is turned off

                      Québec wrote:
                      [color=blue]
                      > So. The @ is what turns on the "conditionn al compilation is turned off"[/color]

                      As you can read in the linked documentation, `@' is part of statements for
                      conditional compilation in JScript, but you need to enable that first. If
                      you do not and use ´@' *outside* of String/RegExp literals followed by a
                      alphabetic character anyway, the JScript engine assumes that you are using
                      such a statement and you get that error message. Tested with IE 6.0 SP-1
                      on Win2k.
                      [color=blue][color=green]
                      >>http://msdn.microsoft.com/library/de...-us/jscript7/h[/color]
                      > tml/jsconconditiona lcompilationsta tements.asp
                      > Aren't we on a javascript newsgroup?[/color]

                      We are. JavaScript is Netscape's implementation of ECMAScript, and JScript
                      is Microsoft's implementation of ECMAScript used in Internet Explorer which
                      has some special features, as you have seen.


                      PointedEars

                      Comment

                      Working...