Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Javascript variable use

Status
Not open for further replies.

iwgalloway

Programmer
Joined
Jan 24, 2006
Messages
3
Location
CA
Hi - I'm VERY new to Javascript and I'm editing a script used in my site...

The script sets a lot of variables as follows

Code:
var imagepath="0_galleries/05_12_15/Thumbs/" 
var targetlinkdir="0_galleries/05_12_15/Full/"
etc etc etc

I want to have the
Code:
05_12_15
bit of the string defined by another variable, so that I only have to change one variable to update the page.

How would I define this variable and use it within the other variables' paths?

Thanks
 
Code:
[attn]var blah = "05_12_15";[/attn]
var imagepath="0_galleries/[attn]" + blah + "[/attn]/Thumbs/"
var targetlinkdir="0_galleries/[attn]" + blah + "[/attn]/Full/"

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top