Need for 3rd kind of paranthesis

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pavel Vetesnik

    Need for 3rd kind of paranthesis

    Hello,

    my question is probably quite stupid, but I really don't know how to solve
    it.
    I have code like this:
    =============== =============== =============== ==
    <button title="Osobní nastavení (jméno a heslo)"
    onClick="window .location.href= 'el_cas.Funkce. editace_uzivate le([el_cas.el_ca
    sopisy.zacatek? cDruhAplikace=c asopisy])'">My setup</button>
    =============== =============== =============== ==

    The problem is, that I have double paranthesis (") surrounding the onClick
    reference, inside of them are single paranthesis (') and now I need another
    ones for passing parameter of the function.
    In the example above it is surrounded by ([]) marks. That doesn't work on
    HTML page, of course.

    Please can you help me with this?

    Thank you in advance!
    Pavel


  • Martin Honnen

    #2
    Re: Need for 3rd kind of paranthesis



    Pavel Vetesnik wrote:[color=blue]
    > Hello,
    >
    > my question is probably quite stupid, but I really don't know how to solve
    > it.
    > I have code like this:
    > =============== =============== =============== ==
    > <button title="Osobní nastavení (jméno a heslo)"
    > onClick="window .location.href= 'el_cas.Funkce. editace_uzivate le([el_cas.el_ca
    > sopisy.zacatek? cDruhAplikace=c asopisy])'">My setup</button>
    > =============== =============== =============== ==
    >
    > The problem is, that I have double paranthesis (") surrounding the onClick
    > reference, inside of them are single paranthesis (') and now I need another
    > ones for passing parameter of the function.
    > In the example above it is surrounded by ([]) marks. That doesn't work on
    > HTML page, of course.
    >
    > Please can you help me with this?[/color]

    You could write a function and simply call it in the onclick handler.
    Or you can escape the quotes
    window.location .href = 'whatever.php?\ 'string\'';



    --

    Martin Honnen


    Comment

    • Steve Pugh

      #3
      Re: Need for 3rd kind of paranthesis

      "Pavel Vetesnik" <Pavel.Vet@voln y.cz> wrote:
      [color=blue]
      >I have code like this:
      >============== =============== =============== ===
      ><button title="Osobní nastavení (jméno a heslo)"
      >onClick="windo w.location.href ='el_cas.Funkce .editace_uzivat ele([el_cas.el_ca
      >sopisy.zacatek ?cDruhAplikace= casopisy])'">My setup</button>
      >============== =============== =============== ===[/color]

      And what happens when JavaScript is turned off?
      [color=blue]
      >The problem is, that I have double paranthesis (") surrounding the onClick
      >reference, inside of them are single paranthesis (') and now I need another
      >ones for passing parameter of the function.[/color]

      Those are quotes not parentheses. Parentheses are ( and ).

      Anyway, you don't need you single quote marks. You want the
      el_cas.Funkce.e ditace_uzivatel e() to be evaluated as a function not
      treated as a string.

      onClick="window .location.href= el_cas.Funkce.e ditace_uzivatel e('el_cas.el_ca sopisy.zacatek? cDruhAplikace=c asopis')"
      [color=blue]
      >In the example above it is surrounded by ([]) marks. That doesn't work on
      >HTML page, of course.[/color]

      In general you should not include JS code directly in event handlers.
      Simply call a function in the event handler and leave all the actual
      JS code in the function itself (which should probably be in an
      external .js file).

      So, I'd rewrite the JavaScript function so that the
      window.location .href is part of the function and then call the
      function only from the event handler.

      onClick="el_cas .Funkce.editace _uzivatele('el_ cas.el_casopisy .zacatek?cDruhA plikace=casopis y')'"

      If the existing function can not be rewritten then write a new
      function
      onClick="newFun c('el_cas.el_ca sopisy.zacatek? cDruhAplikace=c asopisy')"

      function newFunc(boo) {
      window.location .href = el_cas.Funkce.e ditace_uzivatel e(boo);
      }

      And above all make sure that the essential functionality still works
      when JS is not available.

      Steve

      --
      "My theories appal you, my heresies outrage you,
      I never answer letters and you don't like my tie." - The Doctor

      Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

      Comment

      • Anonymous Joe

        #4
        Re: Need for 3rd kind of paranthesis

        "Pavel Vetesnik" <Pavel.Vet@voln y.cz> wrote in message
        news:be3h0g$16t e$1@ns.felk.cvu t.cz...[color=blue]
        > Hello,
        >
        > my question is probably quite stupid, but I really don't know how to solve
        > it.
        > I have code like this:
        > =============== =============== =============== ==
        > <button title="Osobní nastavení (jméno a heslo)"
        >[/color]
        onClick="window .location.href= 'el_cas.Funkce. editace_uzivate le([el_cas.el_ca[color=blue]
        > sopisy.zacatek? cDruhAplikace=c asopisy])'">My setup</button>
        > =============== =============== =============== ==
        >
        > The problem is, that I have double paranthesis (") surrounding the onClick
        > reference, inside of them are single paranthesis (') and now I need[/color]
        another[color=blue]
        > ones for passing parameter of the function.
        > In the example above it is surrounded by ([]) marks. That doesn't work on
        > HTML page, of course.
        >
        > Please can you help me with this?
        >
        > Thank you in advance!
        > Pavel[/color]

        There are three kinds of parentheses, the primary one is ( and ), the
        secondary is [ and ], and the tetriary one is { and }.

        But you are using quotes. There is just the two, the primary double
        quote -- " and the secondary single quote, or the quote within a quote, '.

        I find it odd that you would need a third quote, since nobody else in the
        world has found a need for one.

        Where you have marked what you would want to put in the tetriary quotes, the
        non-existent ones, doesn't even need quotes as it is enclosed in
        parentheses.

        However, Javascript has a little problem where it is turned off in ~15% of
        people's PCs and some browsers just outright don't allow Javascript, so
        there could be 20% if not more of your viewers will be very frustated by
        your persistent use of buttons that do things that a simple <a
        href="2nd-page.html"> could do, or a <a href="2nd-page.html"><img
        src="button-decoy.gif" border="0"></a>.

        See?


        Comment

        • Toby A Inkster

          #5
          Re: Need for 3rd kind of paranthesis

          On Fri, 04 Jul 2003 15:32:03 +0000, Anonymous Joe wrote:
          [color=blue]
          > There are three kinds of parentheses, the primary one is ( and ), the[/color]

          No, there are only two: ( and ).
          [color=blue]
          > secondary is [ and ],[/color]

          These are brackets.
          [color=blue]
          > and the tetriary one is { and }.[/color]

          These are braces.

          --
          Toby A Inkster BSc (Hons) ARCS | mailto:tobyink@ goddamn.co.uk | pgp:0x6A2A7D39
          aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:tai@jabb er.linux.it
          http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
          playing://coldplay/parachutes/05_yellow.ogg

          Comment

          • Anonymous Joe

            #6
            Re: Need for 3rd kind of paranthesis

            "Toby A Inkster" <UseTheAddressI nMySig@deadspam .com> wrote in message
            news:pan.2003.0 7.04.17.52.46.1 50772@goddamn.c o.uk...[color=blue]
            > On Fri, 04 Jul 2003 15:32:03 +0000, Anonymous Joe wrote:
            >[color=green]
            > > There are three kinds of parentheses, the primary one is ( and ), the[/color]
            >
            > No, there are only two: ( and ).
            >[color=green]
            > > secondary is [ and ],[/color]
            >
            > These are brackets.
            >[color=green]
            > > and the tetriary one is { and }.[/color]
            >
            > These are braces.
            >
            > --
            > Toby A Inkster BSc (Hons) ARCS | mailto:tobyink@ goddamn.co.uk |[/color]
            pgp:0x6A2A7D39[color=blue]
            > aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:tai@jabb er.linux.it
            > http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
            > playing://coldplay/parachutes/05_yellow.ogg[/color]

            OK, I can't argue here, but if you think back to algebra class, in an
            equation, you might have the brackets as a 2nd parentheses, but you would
            use the braces to delimit domain/range.... sort of like:

            y = [x(x-2)]
            x={1,2,3}

            fairly simple, tho




            Comment

            • VBDude

              #7
              Re: Need for 3rd kind of paranthesis

              Make a function

              "Pavel Vetesnik" <Pavel.Vet@voln y.cz> wrote in message
              news:be3h0g$16t e$1@ns.felk.cvu t.cz...[color=blue]
              > Hello,
              >
              > my question is probably quite stupid, but I really don't know how to solve
              > it.
              > I have code like this:
              > =============== =============== =============== ==
              > <button title="Osobní nastavení (jméno a heslo)"
              >[/color]
              onClick="window .location.href= 'el_cas.Funkce. editace_uzivate le([el_cas.el_ca[color=blue]
              > sopisy.zacatek? cDruhAplikace=c asopisy])'">My setup</button>
              > =============== =============== =============== ==
              >
              > The problem is, that I have double paranthesis (") surrounding the onClick
              > reference, inside of them are single paranthesis (') and now I need[/color]
              another[color=blue]
              > ones for passing parameter of the function.
              > In the example above it is surrounded by ([]) marks. That doesn't work on
              > HTML page, of course.
              >
              > Please can you help me with this?
              >
              > Thank you in advance!
              > Pavel
              >
              >[/color]


              Comment

              Working...