Help changing page contents

J

JJM

Can anyone please help me with this I'm a total newbie and just getting
started in JS.

I have a page where I would like to display a picture and a short textual
explanation of the picture. I have several pictures that I would like to
display all linking from a previous page. At present what I'm doing is
linking each thumbnail to an individual html page showing the larger image
with the text. It struck me that as the rest of the page is the same and
only the large image and text change for each thumbnail cann I not have a
single page and pass parameters indicating which image and text to use. I
know it sounds like I'm asking you to write my code for me but any help
would be appreciated.

Cheers

JJM
 
D

David Dorward

JJM said:
I have a page where I would like to display a picture and a short textual
explanation of the picture. I have several pictures that I would like to
display all linking from a previous page. At present what I'm doing is
linking each thumbnail to an individual html page showing the larger image
with the text. It struck me that as the rest of the page is the same and
only the large image and text change for each thumbnail cann I not have a
single page and pass parameters indicating which image and text to use

While it is /possible/ to do this using JavaScript, it is not a good idea.
Client side scripting is excellent for enhancing content, but not reliable
enough to depend on to /generate/ content (well, unless you don't care
about 10%[1] of your visitors including search engine indexing robots).

This is more a job for a server side process such as CGI (with Perl, Python,
Ruby, or another language handling the HTML generation), mod_perl, PHP, ASP
(with VBScript, PerlScript or JScript), JSP, etc.

You can form your URL along the lines:
http://www.myserver.com/myPage.cgi?image=this.jpeg&text=some text
or, with some trickery
http://www.myserver.com/myPage/this.jpeg/some text

Then you can read the variables back in the script and stick them in
placeholders in the document.

Going a stage further, you could store the data in a database on the server,
and then provide much shorter (and cleaner) URLs.

http://www.devshed.com/ is a reasonable place to start learning about server
side programming.

[1] Usual warnings about statistics apply
 
J

Jeff North

| Can anyone please help me with this I'm a total newbie and just getting
| started in JS.
|
| I have a page where I would like to display a picture and a short textual
| explanation of the picture. I have several pictures that I would like to
| display all linking from a previous page. At present what I'm doing is
| linking each thumbnail to an individual html page showing the larger image
| with the text. It struck me that as the rest of the page is the same and
| only the large image and text change for each thumbnail cann I not have a
| single page and pass parameters indicating which image and text to use. I
| know it sounds like I'm asking you to write my code for me but any help
| would be appreciated.

To do this you would need to use server-side scripting (ASP, Perl, PHP
etc).

Find out what your web host uses. I have an ASP/VBScript script
(borrowed from elsewhere :) of course) that will open a window to the
size of the selected image. If your text is only one or two lines then
the window size can easily be re-adjusted.
 
J

JJM

Thanks guys. I'm going to look at server side stuff to do this. I've just
changed my hosting company to one that will allow me to upload my own
scripts and let me host a mySQL database.

JJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,274
Latest member
JessMcMast

Latest Threads

Top