Can someone please point the way? IFRAME troubles

A

alxasa

Hi, this is my present configuration

<FRAMESET ID="MAIN_BODY" FRAMESPACING="0" ROWS="100%,*"
FRAMEBORDER="0">
<FRAME NAME="frameA" SRC="./contentA.htm">
<FRAME NAME="frameB" SRC="./contentB.htm">
</FRAMESET>


'contentA.htm' has a <IFRAME> inside of it, with the ID/NAME of
"internal"

So, what I want to do, is from this IFRAME named 'internal', call a
Javascript function sitting in the contentB.htm file.

I've tried: top.frameB.functionname() but get "frameB" is null or not
an object.

Any help would be really awesome. Thank you!

Alexia
 
K

Kevin Darling

<FRAMESET ID="MAIN_BODY" FRAMESPACING="0" ROWS="100%,*">
<FRAME NAME="frameA" SRC="./contentA.htm">
<FRAME NAME="frameB" SRC="./contentB.htm">
</FRAMESET>

'contentA.htm' has a <IFRAME> inside of it [...]
So, what I want to do, is from this IFRAME named 'internal', call a
Javascript function sitting in the contentB.htm file.

I've tried: top.frameB.functionname() but get "frameB" is null or not
an object.

We have a corporate application that does this all the time. Using
either "top." or "parent.parent." should work fine.

One reason it wouldn't work is if one of the frames actually comes from
a different website. Then security will prevent you from accessing the
other frame.

Cheers, Kev
 
E

endlesstide

Kevin said:
<FRAMESET ID="MAIN_BODY" FRAMESPACING="0" ROWS="100%,*">
<FRAME NAME="frameA" SRC="./contentA.htm">
<FRAME NAME="frameB" SRC="./contentB.htm">
</FRAMESET>

'contentA.htm' has a <IFRAME> inside of it [...]
So, what I want to do, is from this IFRAME named 'internal', call a
Javascript function sitting in the contentB.htm file.

I've tried: top.frameB.functionname() but get "frameB" is null or not
an object.

We have a corporate application that does this all the time. Using
either "top." or "parent.parent." should work fine.

One reason it wouldn't work is if one of the frames actually comes from
a different website. Then security will prevent you from accessing the
other frame.

Cheers, Kev

Hi Kev! This is on the same domain, so no security issues. But, I
tried both of those top.top.frameB.functionname() and
parent.parent.frameB.functionname() but it doesn't work (still get the
'null or not an object error') Do you think it be something else?
Thank you so much for looking at this -- this is trying me bonkers!!
 
J

jojo

<FRAMESET ID="MAIN_BODY" FRAMESPACING="0" ROWS="100%,*">
<FRAME NAME="frameA" SRC="./contentA.htm">
<FRAME NAME="frameB" SRC="./contentB.htm">
</FRAMESET>

'contentA.htm' has a <IFRAME> inside of it [...]
So, what I want to do, is from this IFRAME named 'internal', call a
Javascript function sitting in the contentB.htm file.

I've tried: top.frameB.functionname() but get "frameB" is null or not
an object.
We have a corporate application that does this all the time. Using
either "top." or "parent.parent." should work fine.

One reason it wouldn't work is if one of the frames actually comes from
a different website. Then security will prevent you from accessing the
other frame.

Cheers, Kev

Hi Kev! This is on the same domain, so no security issues. But, I
tried both of those top.top.frameB.functionname() and
parent.parent.frameB.functionname() but it doesn't work (still get the
'null or not an object error') Do you think it be something else?
Thank you so much for looking at this -- this is trying me bonkers!!

Don't know if it's the solution, but try top.frameB.document.functionname()

HTH, jojo
 
K

Kevin Darling

Hi Kev! This is on the same domain, so no security issues. But, I
tried both of those top.top.frameB.functionname() and
parent.parent.frameB.functionname() but it doesn't work (still get the
'null or not an object error')

Time to start debugging :)

Put this line somewhere in your "internal" IFRAME page:

alert(parent.name);

It should say "frameA". If it fails or gives the iframe name
"internal", then IE thinks whatever's in the IFRAME has no permission
to break out of its box... in which case, IE limits parent and top to
the IFRAME itself.

Oh, and is it _exactly_ the same domain? Otherwise search the news
group for "cross domain scripting" help.

Etc. Kev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top