Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Question about question mark in JavaScript

Reply
Thread Tools

Question about question mark in JavaScript

 
 
Jimolo
Guest
Posts: n/a
 
      01-20-2008
Hi

What does a questionmark before a variable do?

For instance,

var test1 = ''

var test2 = '?test1'

What does it do?
 
Reply With Quote
 
 
 
 
The Natural Philosopher
Guest
Posts: n/a
 
      01-20-2008
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
>

 
Reply With Quote
 
 
 
 
Gregor Kofler
Guest
Posts: n/a
 
      01-20-2008
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 With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
David Mark's Javascript Tip of the Day - Volume #1 - #Tip 14-C David Mark Javascript 16 11-11-2011 02:45 AM
David Mark's Javascript Tip of the Day David Mark Javascript 4 11-08-2011 06:52 PM
David Mark's Javascript Tip of the Day David Mark Javascript 5 11-07-2011 09:17 PM
To Mark Fitzpatrick, Juan Libre, Mark Rae, Steve Orr, Cowboy and other MVPs Cirene ASP .Net 5 05-17-2008 07:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57