By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,321 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

Help changing page contents

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
JJM wrote:
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?i...xt=some%20text
or, with some trickery
http://www.myserver.com/myPage/this.jpeg/some%20text

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

--
David Dorward http://david.us-lot.org/
Jul 20 '05 #2

P: n/a
On Sat, 19 Jul 2003 23:26:16 +0100, in comp.lang.javascript "JJM"
<jo********@clara.net> wrote:
| 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.
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 20 '05 #3

P: n/a
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
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.