Question about question mark in JavaScript - Javascript

This is a discussion on Question about question mark in JavaScript - Javascript ; Hi What does a questionmark before a variable do? For instance, var test1 = '' var test2 = '?test1' What does it do?...

+ Reply to Thread
Results 1 to 4 of 4

Question about question mark in JavaScript

  1. Default Question about question mark in JavaScript

    Hi

    What does a questionmark before a variable do?

    For instance,

    var test1 = ''

    var test2 = '?test1'

    What does it do?

  2. Default Re: Question about question mark in JavaScript

    Jimolo wrote:

    > Hi
    >
    > What does a questionmark before a variable do?
    >
    > For instance,
    >
    > var test1 = ''
    >
    > var test2 = '?test1'
    >
    > What does it do?


    In what context do you mean this?
    Normally I would say its a query after an URL like;

    instance 1
    http://www.domain.ext/page.htm

    instance 2
    http://www.domain.ext/page.htm?test1

    Where in 2nd instance there will be a query carried out on the page
    (this can for instance been used to pass a variable to the page)

    Works like this
    http://www.rhi.nl/contact/bedankttr....3&naam=Richard

    Greetz,
    Richard


  3. Default Re: Question about question mark in JavaScript

    Richard Hijdra wrote:
    > Jimolo wrote:
    >
    >> Hi
    >>
    >> What does a questionmark before a variable do?
    >>
    >> For instance,
    >>
    >> var test1 = ''
    >>
    >> var test2 = '?test1'
    >>
    >> What does it do?

    >
    > In what context do you mean this?
    > Normally I would say its a query after an URL like;
    >

    three meanings in my 'bible'

    the one you stated..URL stuff.

    Then teh normal C style compact condtional as in

    a=(b==c)?d:e;

    (if b equals c, set a to d, else set a to e)

    Or a part of a regexp pattern matching string thing.



    > instance 1
    > http://www.domain.ext/page.htm
    >
    > instance 2
    > http://www.domain.ext/page.htm?test1
    >
    > Where in 2nd instance there will be a query carried out on the page
    > (this can for instance been used to pass a variable to the page)
    >
    > Works like this
    > http://www.rhi.nl/contact/bedankttr....3&naam=Richard
    >
    >
    > Greetz,
    > Richard
    >


  4. Default Re: Question about question mark in JavaScript

    Jimolo meinte:
    > Hi
    >
    > What does a questionmark before a variable do?
    >
    > For instance,
    >
    > var test1 = ''
    >
    > var test2 = '?test1'
    >
    > What does it do?


    Here? test2 contains the string "?test1". There is no "question mark
    before a variable".

    Gregor


    --
    http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://web.gregorkofler.com ::: meine JS-Spielwiese
    http://www.image2d.com ::: Bildagentur für den alpinen Raum

+ Reply to Thread