T
Timmy
I'm working on a simple click-through image gallery and I have images with
captions in two arrays like this:
var current_value="0";
var images = new Array
("photo01.jpg",
"photo02.jpg",
"photo02.jpg");
var captions = new Array
("caption1",
"caption2",
"caption3");
The large image views are shown in a window which I can link to with a
search substring URL defining which image to display: popup.html?image02.jpg
I then extract the search string like this:
display = window.location.search;
photo = display.substring (display.lastIndexOf('?') +1);
By knowing the search substring value (in this case photo02.jpg) I would
like a regex function to search through the images array and find the match
(in this case index 1) and therafter use that index value to set the
current_value variable.
Does anyone have an idea how the searching and matching is done?
captions in two arrays like this:
var current_value="0";
var images = new Array
("photo01.jpg",
"photo02.jpg",
"photo02.jpg");
var captions = new Array
("caption1",
"caption2",
"caption3");
The large image views are shown in a window which I can link to with a
search substring URL defining which image to display: popup.html?image02.jpg
I then extract the search string like this:
display = window.location.search;
photo = display.substring (display.lastIndexOf('?') +1);
By knowing the search substring value (in this case photo02.jpg) I would
like a regex function to search through the images array and find the match
(in this case index 1) and therafter use that index value to set the
current_value variable.
Does anyone have an idea how the searching and matching is done?