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.
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.