[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using onLoad in FRAMESET

>I have a situation in which I'm trying to use the onLoad event within a 
><frameset> tag (rather than a <body> tag). The docs say that it is 
>possible, and indeed it appears to work in most cases, but in my 
>situation it's not working. Here's waht I'm trying to do:
>I have a "main" window which contains a collection of javascript 
>functions.  From this window, I create other windows and set up a 
>pointer back to my main window (by creating a property in the child 
>window called "mainWindow" so that the "child" windows can communicate 
>with the "parent" (main) window.  In order to make all this work I use 
>the onLoad attribute in the <body> tag to call a 
>mainWindow.registerWinow() function back in the main window. This works 
>like a charm when using the <body> tag. But when I have a document which 
>is uses <frameset>, the pointer which I've set up when I opened the 
>window appears to be corrupted, and I get javascript errors indicating 
>that the window (child) does not know about the mainWindow.register() 
>I know this might be confusing, but sending the actual javascript would 
>be even more confusing I think.  Does abybody have any idea if something 
>about the <frameset> is causing the window to corrupt properties which I 
>have created in it? Since this works fine when I'm using a document with 
>the <body> tag but not with the <frameset> tag, I suspect something 
>about frames is conflicting with the properties which I have created in 
>the window.

I have a similar situation. I have all my code/date loaded in the frameset 
page. I have found that data gets corrupted when you access same from other
the the framset page. This is a bug with Netscape 2.0. I think the workaround
is to use functions in your frameset page to set and get value. Something like.

setValue(parent.variable, value);
parent.variable = getValue(parent.variable);

The following code in your frameset page:

function setValue(variable, value)
    variable = value;

function getValue(variable)
    return variable;

Hope this helps.
[Daniel Grealy daniel@dircon.co.uk]

This message came from the mailing list javascript. For help using the
mailing list software, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.