Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Can someone please point the way? IFRAME troubles

Reply
Thread Tools

Can someone please point the way? IFRAME troubles

 
 
alxasa@gmail.com
Guest
Posts: n/a
 
      07-23-2006
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

 
Reply With Quote
 
 
 
 
Kevin Darling
Guest
Posts: n/a
 
      07-23-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) 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 <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

 
Reply With Quote
 
 
 
 
endlesstide@gmail.com
Guest
Posts: n/a
 
      07-23-2006

Kevin Darling wrote:
> (E-Mail Removed) 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 <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!!

 
Reply With Quote
 
jojo
Guest
Posts: n/a
 
      07-23-2006
(E-Mail Removed) 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 <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
 
Reply With Quote
 
Kevin Darling
Guest
Posts: n/a
 
      07-23-2006
(E-Mail Removed) 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
Can someone please point the way? IFRAME troubles alxasa@gmail.com HTML 4 07-23-2006 09:42 PM
Scenario 5: IS-IS routing on Frame Relay Multi-point and Point-to-Point David Sudjiman Cisco 0 06-08-2006 09:11 AM
can someone help with this complicated <IFRAME>... Mel HTML 2 12-13-2004 08:24 PM
Get form values from iframe (1) to iframe (2) inside a layer in iframe (1) Daedalous Javascript 3 01-16-2004 11:08 AM



Advertisments