View Full Version : Open htm_page (in frame), with Variables inserted

06-06-2003, 08:37 PM
I am not used to using java, and amd having trouble figuring out the syntax for transferring variables to another page.

<base target=DisplayFrame>
In a frame I have an htm with pictures listed as:
<a href=PIC><img src PIC width%>PicData</a>

As the pictures are different sizes, the width % displays the PICs, in the frame, with auto-sizing (frame width is fixed)

When I clk the PICs to have them load full size to the Display frame, I have no size or alignment control.

A workaround is to have the anchor point to an htm, with the PIC in it; where I can then control how the frame is to display, but in this scenario, I have to have an individual htm file for each PIC.

What I want to do is have one htm file that accepts the input of the anchor references as variables.

Although this code doesn't work this is what I am tring to do:

<a href=open.Display.htm .with var_Pic, var_PICData ><img src PIC width%>PicData</a>

I am used to writing code with variables (dBase, Works, Access), but for the last 2 weeks, I haven't been able to figure this java or script version out. I realize I could also use an array (although I would have to learn that too), but I still don't understand how to transfer the variable data to another page for its use.

Would appreciate a concise explanation of how to use variables, and transfer their values (or a pointer to a good reference).


1/2 of my experiments were on how to write the image directly to the frame display, with the controls needed to format the picture setup. I tried diferent mouse-over systems, but usually any interference within the anchor (extra code) causes the image in current frame to not load, or the anchors display frame to error.

The control I use with the anchor-htm-frame method is simply a height %. That way, any size image will display completely, within the display frame. The combination of these 2 different screen-image calls permits me to use just a single image-file for the 2 different frame views, which is not effected by user resolution or windows size (or resizes in any browser use).

06-06-2003, 10:10 PM
a link to the stuff would be nice and make it easier to find out what it is your trying to do?

06-06-2003, 11:11 PM
There is no link to this stuff, as I wouldn't post it, till it was ready and debugged.

The useage will be for both web access and from custom cds

The problem mentioned is straightforward, summary:

A frameset is loaded. I have pictures showing on a side frame, users can see the pics and decide which ones they want to see in a larger view. When they click a PIC, it shows up in a larger Display frame.

Using PIC_1.htm (a different one for each image), that opens in the display frame:

<HTML><HEAD><Title> ..\PIC_1.htm </Title></HEAD>
<img src=PIC_1.jpg Height=99% align=right> PIC data

So I am asking how use variables from the selection frame, so that I only need one .htm file for all the Pics that would work something like this:
<img src= "Var_Pic" Height=99% align=right> "Var_PICdata"

The pics themselves are different sizes, and when sent directly to the display frame - overfill the frame. The pics are stored in their orignal full quality (large) format. Reducing the Pic size (and quality) especially for the CD model, is a poor option.

If you don't understand the question I asked, tell me what it is that is not clear, and I will clarify.

Thanks, Majic

06-06-2003, 11:30 PM
the last was more clear :), this chould work, if u need more varirable just expand the function.

<a href="#" onClick="parent.DisplayFrame.newPic('largePic');"><img src=smallPic></a>

display.html to be in display framen.

function newPic(aPic)
<img id=largePic src="">

06-07-2003, 01:49 AM
Tossed this together in a hurry (the original used pop-ups). Hope it works/helps:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<frameset cols="136,*" frameborder="0">
<frame name="nav" src="nav.htm">
<frame name="DisplayFrame" src="display.htm">


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<style type="text/css">

img {
border: 1px #cccccc solid;
cursor: hand;
cursor: pointer;

<script type="text/javascript" language="javascript">

var picframe = 'DisplayFrame';
var HTML;

function show_picframe(url, BG) {
if (!BG) BG = '#000000';
HTML = '';
HTML += '<html><head><title></title></head>';
HTML += '<body style="margin:0px;background:' + BG + ';" bgcolor="#000000">';
HTML += '<table width="100%" height="100%"><tr><td align="center">';
HTML += '<img src="' + url + '" border="0" />';
HTML += '</td></tr></table></body></html>';
top[picframe].location = 'javascript&#58;top.nav.HTML';
return false;

<img src="http://images.google.com/images?q=tbn:Xyd8Su1RAnoC:grove.ufl.edu/~brasa/tomato%25201.gif" title="CLICK ME"
onclick="return show_picframe('http://grove.ufl.edu/~brasa/tomato%201.gif','white')">


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

06-07-2003, 06:06 AM
Just looking at the codes supplied now, will try them out. In the meantime I was trying to see if I could do it with CSS, with the overflow-x or Y command, but have not figured out yet how to implement the command. I have been trying to associate it with the target tag

Target {Overflow-x:visible; Overflow-y:visible;}

Well off to experiment

06-07-2003, 11:09 AM
This came close as it did open a controlled pic in the display frame, but it also imported all of the body data, and all of the screen images as well, so the whole TOC loaded into the display frame:

| | |
| Top Pane | |
____| ___________________ | M |
| | E |
T | | N |
O | Display | U |
C | | |
| | |
|____________________| |
| | |
| Bottom Panel | |

This is a rough drawing of my frames. Selections are started from menu, then the small PIcs are loaded to TOC, and when clicked the individual pics load to display.

Width% sets size for TOC Pics (many pics), and Height% sizes in Display.

So being the TOC settings got imported into the display, they were loaded as a width% and still overflowed.

Also, where you said to put the receving anchor in the display.htm, although this did work, it interfered with my intial display. I tried putting the anchor in the frames window, instead and it worked (at least as far as the Pic/TOC loaded into display).

This may have worked being I don't have any body commands in my frameset, and all the frame commands are in the <head>

But what is important is that I am seeing how to transfer the variables from frame to frame.

It was my intention to transfer using a container.htm with variables set to it and then target at display (as opposed to having to write an individual .htm per pic),

which the script shown by cheesebagpipe appears to do. Actually he doesn't do that, but rather is creating a virtual page on the fly.

Cheesebagpipe: I wanted to avoid this technique, as I thought the hard-file transfer would be the most sound and least java intensive, BUT the pages load 3 times faster then my hardcopy pages, so that is what I am now working on. Running into a bit of a problem in mocking up the vitual pages, as I am trying to implement CSS data in the setup, using Class= or ID=. So far, this data is ignored, although is accepted if I hardcode it directly into the virtual page.

Thanks to both of you for taking the time to write me up some code, that I could play with. If you have any more suggestion, feel free. When I get the model working, I'll post the code

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum