Setting parent variable in frames, how to recall that variable in string |
Setting parent variable in frames, how to recall that variable in string |
brauer |
Mar 28 2007, 05:42 PM
Post
#1
|
Novice Group: Members Posts: 20 Joined: 22-February 07 Member No.: 1,990 |
I have a 2 frame page and want to set 2 variables selected from one frame to the parent index. Then call on those selected variables within the second frame.
Here's the code from the index. Where arg1 and arg2 are the variables I want to set from the first frame. <html> <head> <title>QuikScat Development</title> <script type="text/javascript"> arg1 = ''; arg2 = ''; </script> </head> <FRAMESET ROWS="30,*" CELLSPACING=0 CELLPADDING=0 BORDER=0> <FRAME SRC="menu.html" NAME="top" SCROLLING=NO MARGINWIDTH=1 MARGINHEIGHT=1> <FRAME SRC="wholequikscatday.html" NAME="main"> </FRAMESET> </html> Then here's the some of the code from the first frame where the variables are selected and set. SCRIPT> function qscat() { month = document.qscat.Month.value; day = document.qscat.Day.selectedIndex + 1; year = document.qscat.Year.value; if (month=="1") { numdays = 0;} else if (month=="2") { numdays = 31;} else if (month=="3") { numdays = 59;} else if (month=="4") { numdays = 90;} else if (month=="5") { numdays = 120;} else if (month=="6") { numdays = 151;} else if (month=="7") { numdays = 181;} else if (month=="8") { numdays = 212;} else if (month=="9") { numdays = 243;} else if (month=="10") { numdays = 273;} else if (month=="11") { numdays = 304;} else if (month=="12") { numdays = 334;} if (year==1996 || year==2000 || year==2004 || year==2008) { numdays = numdays + 1;} numdays = numdays + day; parent.arg1 = year; parent.arg2 = numdays; linkstring = "http://www.geocities.com/fbskibum/qscat/wholequikscatday2.html" window.open(linkstring,'main'); } Then here's some code from the second frame where the variables are put into a string to reference an image. <IMG SRC="http://140.90.47.40/qscat_archive21/QS" + parent.arg1 + parent.arg2 + "/whole_as.png" ISMAP alt="" width="643" height="483" align="center" usemap="#QuikScatMap1"> What am I doing wrong??? Thanks in advance. This post has been edited by brauer: Mar 28 2007, 05:47 PM |
brauer |
Mar 28 2007, 06:23 PM
Post
#2
|
Novice Group: Members Posts: 20 Joined: 22-February 07 Member No.: 1,990 |
Here's the page in case you're interested.
http://www.geocities.com/fbskibum/qscat/ I just got frustrated with this today. I basically want to have the initial page pull todays current images. Then have the ability to chose a year/month/day from the past, calculate the julian day and then reference particular images with the selected variables. This post has been edited by brauer: Mar 28 2007, 06:28 PM |
Christian J |
Mar 28 2007, 06:59 PM
Post
#3
|
. Group: WDG Moderators Posts: 9,661 Joined: 10-August 06 Member No.: 7 |
Here's some info on frames and javascript http://www.quirksmode.org/js/frameintro.html
|
brauer |
Mar 28 2007, 11:13 PM
Post
#4
|
Novice Group: Members Posts: 20 Joined: 22-February 07 Member No.: 1,990 |
I've been messing around with it, but haven't quite figures it out. I think the problem is with how I trying to call the img scr. Is this wrong... <IMG SRC="http://140.90.47.40/qscat_archive21/QS" + "2005" + "005" + "/whole_as.png" ISMAP alt=" width="643" height="483" align="center" usemap="#QuikScatMap1"> The image I'm trying to display is http://140.90.47.40/qscat_archive21/QS2005005/whole_as.png |
Darin McGrew |
Mar 29 2007, 01:28 PM
Post
#5
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Is this wrong... Is that the HTML? Or is that part of some other file that is generating the HTML?<IMG SRC="http://140.90.47.40/qscat_archive21/QS" + "2005" + "005" + "/whole_as.png" ISMAP alt=" width="643" height="483" align="center" usemap="#QuikScatMap1"> (Also, you have an unmatched quote for the alt attribute.) The HTML needs to look like this: CODE <img src="http://140.90.47.40/qscat_archive21/QS2005005/whole_as.png" ismap alt="" width="643" height="483" align="center" usemap="#QuikScatMap1"> |
brauer |
Mar 29 2007, 01:50 PM
Post
#6
|
Novice Group: Members Posts: 20 Joined: 22-February 07 Member No.: 1,990 |
Is this wrong... Is that the HTML? Or is that part of some other file that is generating the HTML?<IMG SRC="http://140.90.47.40/qscat_archive21/QS" + "2005" + "005" + "/whole_as.png" ISMAP alt=" width="643" height="483" align="center" usemap="#QuikScatMap1"> (Also, you have an unmatched quote for the alt attribute.) The HTML needs to look like this: CODE <img src="http://140.90.47.40/qscat_archive21/QS2005005/whole_as.png" ismap alt="" width="643" height="483" align="center" usemap="#QuikScatMap1"> This was just part of code in the second frame. The reason I had it broken up was to eventually put variables which would substitute in for the year "2005" and julian day "005", which would look something like this: <IMG SRC="http://140.90.47.40/qscat_archive21/QS" + year + day + "/whole_as.png" ISMAP alt=" width="643" height="483" align="center" usemap="#QuikScatMap1"> The reason I want variables is because I would like the user to be able to chose the year and day from frame 1 and then have frame 2's images reload with the chosen dates. I was hoping to do it with javascripting to set the variable from frame 1 to the index, and then have frame 2 call on the index variables that were set. But I'm proving to be a crap javascripter. However I wasn't able to get it to work with the variables, and simply can't get it to work just putting in a arbitrary year and date. I know it's a coding problem, just couldn't figure out how to do it right. You're incite would be greatly appreciated. This post has been edited by brauer: Mar 29 2007, 01:54 PM |
Lo-Fi Version | Time is now: 27th April 2024 - 05:53 AM |