Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to create a common HTML page to display details of images selected from a previous page

Posted on 2013-01-28
1
Medium Priority
?
269 Views
Last Modified: 2013-02-19
In a web application (with HTML, javascript, CSS etc)I am creating a start up HTML page that contain lots of images.

Then when the user clicks any of the images, another window pops up with details of that selected image. This page contains
1. The larger version of the of image
2. Detailed description

I want to keep this second message window a common one for all images. So I plan to use
ajax to read details of each image from a file. Then build the contents of the page dynamically using javascript.

By problem is to tell the second window what image was selected from first page so that
I can pull information of that image from the file shwo build the second page dynamically.

So how should I send a value from one page to another in HTML?
0
Comment
Question by:prain
1 Comment
 
LVL 38

Accepted Solution

by:
Tom Beck earned 1000 total points
ID: 38829561
It sounds like you want a modal popup (a div on the same page that you toggle on and off using javascript). This div can be loaded with the necessary image and details using an ajax call to the second page by using an url with a query at the end to hold the id of the image selected.

Example: http://www.mydomain.com/largeImage.html?id=img123

When the second page reads from the file using the image id to select the proper image and details, you can then use some javascript on that page to fill in the blanks, i.e large image path and details text.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question