By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,377 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

Can someone please point the way? IFRAME troubles

P: n/a
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 <IFRAMEinside 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

Jul 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

al****@gmail.com wrote:
<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 <IFRAMEinside 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

Jul 23 '06 #2

P: n/a

Kevin Darling wrote:
al****@gmail.com wrote:
<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 <IFRAMEinside 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!!

Jul 23 '06 #3

P: n/a
en*********@gmail.com wrote:
>><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 <IFRAMEinside 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
Jul 23 '06 #4

P: n/a
en*********@gmail.com wrote:
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

Jul 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.