473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2398
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.javas cript "JJM"
<jo********@cla ra.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****@yourpant sbigpond.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
3518
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. The url is http://switch.hosts.net.nz/~admin64/index.php
3
1783
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 thus far... I have a simple contents-type frame. The left frame is a login page (login.asp) and the right frame is a welcome page (welcome.htm). When someone enters their user name and password, another ASP script I wrote validates the login...
2
1795
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 the site; when I open a new page in 'main', I want its relevant sub-menu to appear in 'rightmenu'. function Contents(newPage)
4
14834
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 update an existing div tag to show what they've typed in? Thanks.
2
1425
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 tried changing some simple code in the .cs but the changes do not reflect on the webpage. Someone told me I need to recompile. Is there anywork around?
1
3721
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 attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am online. Plz....Plz..Plz...
3
2305
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 read the inner HTML of the contents of an iframe and also allows me to write out the inner HTML of the contents of an iframe. However using frames.document.body.innerHTML I am only able to change, in the contents of the iframe, the code in...
4
6460
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) { document.getElementById('iframeid').src = page; } </script>
9
4031
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 element with the javascript contents. But when viewed as a seperate HTML file with the below contents I'm able to see the milonic menu http://www.milonic.com . <div>
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.