Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   Question about question mark in JavaScript (http://www.velocityreviews.com/forums/t934343-question-about-question-mark-in-javascript.html)

Jimolo 01-20-2008 01:43 PM

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?

The Natural Philosopher 01-20-2008 03:07 PM

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
>


Gregor Kofler 01-20-2008 05:02 PM

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


All times are GMT. The time now is 05:04 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.