Click to See Complete Forum and Search --> : Execute a vbscript function in a parent frame from an iframe


Rodney Kendall
06-12-2001, 10:10 PM
I have a b2b site which I originally wrote with a number of SPANs which are
dynamically shown and hidden as the user selects navigation links on the
left and top. This creates the effect of a child frame. The obvious problem
is the speed of downloading all of the various pages together instead on
in a FRAME. I am converting the content of each SPAN to be an IFRAME with
the source page containing the code that used to be the SPAN.

The problem is that I need to call a function in the parent frame to hide
the other SPANs in the parent frame when certain links are selected within
one of the IFRAMEs. Does anyone know the syntax (if any) of how to call
a function within a VBScript SCRIPT block in a parent frame from a child
frame? Is this even possible? I have tried the 'SCRIPTS' collection, but,
MSDN only gives the syntax, not how to do anything useful with the items
in the collection.

Chris
06-13-2001, 09:36 AM
You could try...
window.opener.vbscriptname();
or, window.opener.document.vbscriptname();
something like that should work. You may be able to target the referring
page or opening page by using window.opener, or document.referrer, or window.top
or something like this.

"Rodney Kendall" <rkendall@consultant.com> wrote:
>
>I have a b2b site which I originally wrote with a number of SPANs which
are
>dynamically shown and hidden as the user selects navigation links on the
>left and top. This creates the effect of a child frame. The obvious problem
>is the speed of downloading all of the various pages together instead on
>in a FRAME. I am converting the content of each SPAN to be an IFRAME with
>the source page containing the code that used to be the SPAN.
>
>The problem is that I need to call a function in the parent frame to hide
>the other SPANs in the parent frame when certain links are selected within
>one of the IFRAMEs. Does anyone know the syntax (if any) of how to call
>a function within a VBScript SCRIPT block in a parent frame from a child
>frame? Is this even possible? I have tried the 'SCRIPTS' collection, but,
>MSDN only gives the syntax, not how to do anything useful with the items
>in the collection.

Steve Berzins
06-13-2001, 11:54 AM
in javascript it is...
self.parent.functionName(parameters...);
so it should work like this in vbscript as well I would think. only
difference AFIAK is in javascript case matters, in vb script it should not.


"Rodney Kendall" <rkendall@consultant.com> wrote in message
news:3b26cb8f$1@news.devx.com...
>
> I have a b2b site which I originally wrote with a number of SPANs which
are
> dynamically shown and hidden as the user selects navigation links on the
> left and top. This creates the effect of a child frame. The obvious
problem
> is the speed of downloading all of the various pages together instead on
> in a FRAME. I am converting the content of each SPAN to be an IFRAME with
> the source page containing the code that used to be the SPAN.
>
> The problem is that I need to call a function in the parent frame to hide
> the other SPANs in the parent frame when certain links are selected within
> one of the IFRAMEs. Does anyone know the syntax (if any) of how to call
> a function within a VBScript SCRIPT block in a parent frame from a child
> frame? Is this even possible? I have tried the 'SCRIPTS' collection,
but,
> MSDN only gives the syntax, not how to do anything useful with the items
> in the collection.