Specifying data in <A HREF=""> for page content

I have a website for Star Trek, and I'm creating an object database for the game Star Trek: Generations.

I don't want to create a page for each image, and I don't want them on the same page so can I use something like:

<!-- ON THE OBJECT PAGE -->
<IMG NAME="object">

<!-- ON THE INDEX PAGE -->
<A HREF="objectpage.html" object="image1.gif">IMAGE 1</a><br>
<A HREF="objectpage.html" object="image2.gif">IMAGE 2</a>

If not, what can I use?
tomlacheckiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

knightEknightCommented:
Try this:

<A HREF="objectpage.html?image1.gif">IMAGE 1</a><br>
<A HREF="objectpage.html?image2.gif">IMAGE 2</a>

Then in objectpage.html, do this:

<SCRIPT language='javascript'>
  var theImage = new Image();
  theImage.src = location.search.substring(1);
</script>

<BODY onLoad='document.images.myimage.src=theImage.src'>

<IMG name='myimage'>

</body>
0
knightEknightCommented:
Or, a shorter version of the same thing:

<BODY onLoad='document.images['myimage'].src=location.search.substring(1);'>

 <IMG name='myimage'>

</body>
0
knightEknightCommented:
DOH!  I had a typo.  Let's try again:

<A HREF="objectpage.html?image1.gif">IMAGE 1</a><br>
<A HREF="objectpage.html?image2.gif">IMAGE 2</a>

.... then in objectpage.html:


<BODY onLoad='document.images["myimage"].src=location.search.substring(1);'>

   <IMG name='myimage'>

</body>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tomlacheckiAuthor Commented:
Adjusted points to 50
0
tomlacheckiAuthor Commented:
Thanks - I can't believe how quickly I could implement that code and it just, well, worked!

I've always been trying this sort of thing but never accomplished it.

I've awarded you an A, and your comment is now an answer.

Could I post this code if someone asked *me* how to do it (anywhere) or would I need to mention your name?

In the meantime, check out my site at http://www.deep-space-5.org.uk and I can be reached at ds5@timanfaya.freeserve.co.uk or a number of other addresses.

Thanks again - it's unbelievable!!!!!!

T
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.