Passing values from a function generated html.

C

cirillo_curiosone

Hi,

i'm new to javascript. I started studing it on the web few weeks ago,
but still haven't been able to solve one big problem: HOT TO PASS VALUES
FROM A SCRIPT VARIABLE TO A CHILD HTML GENERATED BY FUNCTION.

Here'e the point:

I'm writing a simple website for showing my photographs. It has a
central page with many links (as many as galleries are).
I thought to built the main page with a for-loop in the following way:

for loop ...
(
document.write(' <a onClick="selected_gal=curr_gal;
make_frameset(selected_gal)">');
document.write(' <img src="../Images/gal_'+curr_gal+'_tn.jpg"
width="120" height="120" border="0">');
document.write(' </a><br>');
)


The function make_frameset is based on the following commands:

<script type="text/javascript">
function make_frameset(gallery_num)
{
....
document.write('<frameset rows="90,360,90">');
document.write(' <frame name="frame1" src="./gal_frame1.html">');
document.write(' <frame name="frame2" src="./gal_frame2.html">');
document.write(' <frame name="frame3" src="./gal_frame3.html"
target="frame2">');
document.write(' <noframes><body></body></noframes>');
document.write('</frameset>');
....
}
</script>

Here's the problem: i haven't been able, right now, to pass the
gallery_num parameter to the child frames (gal_frame#.html) files.
How can i get that value from there? I tried with parent.gallery_num,
but failed.

This is quite important, as it would allow me to use just one html
source for each gallery, with a selection parameters for accessing the
corresponding images.

Thanks a lot in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top