473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help changing page contents

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
3 2086
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: windandwaves | last post by:
Hi Folks I have just completed a project for an accommodation finder in New Zealand - much with your help - thank you again. I would appreciate any constructive or deconstructive comments. ...
3
by: Thomas Brooks | last post by:
Hi all... Quick question for you. I'm trying to change the contents of a frames page after a user has successfully logged in. I'm running into a little bit of difficulty. Here's what I have...
2
by: Robin Somes | last post by:
Hi everyone, Sincere apologies if this has been done to death before. I have a frameset in 3 columns; 'leftmenu', 'main' and 'rightmenu'. The content of 'leftmenu' remains the same throughout...
4
by: engwar | last post by:
I'd like to know if it's possible to change the contents of a div tag based on something the user is doing. For example. If there is a text box on a page and the user types his or her name can I...
2
by: Joshua Tan | last post by:
hey there, I really need some help with this. I have a web application running on Windows 2000 Server , IIS5.0 , .Net Framework 1.1 I have a file.aspx, file.aspx.cs and file.aspx.resx I...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
3
by: David Virgil Hobbs | last post by:
I discovered how to write out the inner HTML of the contents of an Iframe; I want to know how to write out the outerHTML of the contents of an Iframe. frames.document.body.innerHTML allows me to...
4
by: libsfan01 | last post by:
hey this code wont work for my iframe in safari, i cant change the page by changing the src with js: <script language="javascript"> function loadcontent(page) {...
9
by: mevryck | last post by:
Greetings I have a huge Javascript with inclusion of external scripts and all. I got this by doing a XSLT . Now I have the contents in a Javascript variable, but I'm not able to update the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.