Can an image URL be created using split and join on button click and then displayed?

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Can an image URL be created using split and join on button click and then displayed?

I have about 60 images that I would like to display along some discriptive text.
My goal is set up some sort of controller (a set of buttons or links or whatever) for each image.
Each would then have an ID that would be their filename, but NOT the entire URL that most galleries have. It would be the filename only - not even the .jpg at the end!

A little new to javascript? Anyways, you cannot document.write once the page is loaded without overwriting the page, wiping out everything else. I'm not sure what part an array needs to take in this either, though that part seems workable, just that I think it can be accomplished with strings, and that there is no real advantage in using an array(s). I'm not even certain I 100% understand what you want, but I'm pretty sure I get most of it.

You say you have links or buttons with id's that represent the image's filename minus both the path and extension. If all images are in the same folder and all have the same extension, strings will suffice for adding that information. You can setup a container with an image in it, the src attribute can be either a blank image or one that you would like loaded when the page first loads, ex:

You are right - I have not been scripting for much time at all!
I have taken some programming courses for other languages a while back so I can sort of read and understand a lot of the Java code, but I'm still pretty clueless on costucting my own stuff.

I'm not really interested in having the world use this code at the moment. My wife recently started a small eBay business and I am trying to set up a simple way to sort through images and have pertanant infomation come up as well. None of the java gallerys I found on the web handled this very well - all seemed overly complicated and required full URLs for every image (unless PHP was used). The HTML bloated up fast and didn't seem very friendly to make updates.

Thanks for the code BTW - it does EXACTLY what I was looking for!

Ttoday I going to hack around with it some more and see if I can somehow get the button click to execute another JAVA function to maybe use innerHTML to change the description text for the images.

I figured how it would be even slicker to get rid of the button id and just have the script use the button value.
The Java code uses getElementById and unfortunately there isn't such thing as getElementByValue

I modified a little bit of code that can grab the value and returns it in a formHEAD CODE<script type="text/javascript">
function check(buttonvalue)
{
document.getElementById("answer").value=buttonvalue;
}
</script>