| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Iris Folder
Join Date: Apr 2003
Location: smokey
Posts: 2,675
|
Javascript frame targeting
Right - some simple Javascript here that I'm stumbling around all over It's more complicated than this but the crux of what I'm doing is as follows. I have an html page containing 2 frames. A & B I need to extract a variable from a script within one frame using a script in the other. Frame A Script... <script type="text/javascript"> var test = "hello?"; </script> Frame B Script... <script type="text/javascript"> function targetTest { alert(parent.A.test + "- yes I'm here"); } </script> I call targetTest() from an onClick event. <a href="#" onClick="targetTest();"> CLICK TO TEST </a> [edit] it would appear that the above code is in fact fine [/edit] I've obviously got this wrong, doesn't work test is always undefined - help! Never really sure where to post these, guess it should really be in the Programming section, move it if that's where it should live Last edited by dan : 16-09-2003 at 06:09. |
|
|
|
|
|
#2 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,937
|
Code:
You're also (possibly) forgetting to add the parentheses to the targetTest function name. <aside> Are frames really necessary? Do the pros of using them in this case outweigh the cons? </aside> |
|
|
|
#3 (permalink) |
|
Iris Folder
Join Date: Apr 2003
Location: smokey
Posts: 2,675
|
Thanks Bill, i'll make those changes (seems to be working anyway at the moment?) In response to the aside... It really isn't my choice. I'm Rewritting styles for a large Asset Management system (webNative - http://www.Xinet.com) and as far as development options go it is by far the easiest. I am not a Javascript programmer, Actionscript and php are where my skills lie. They may be related but it's still causing me some difficulty and I'm learning on the fly. and this thing is a beast, file after file of code, not fun. Welcome to my ( - current - ) nightmare... |
|
![]() |