Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
calling a function in parent page through iframe?
Old 08-13-2007, 10:34 AM calling a function in parent page through iframe?
Novice Talker

Posts: 6
Trades: 0
Hello

I have an iframe (code below).. what i want to check is whether this iframe has lloaded or not and if not loaded load another page(by javascript checking in main page)

Code:
<div style="font-family:Georgia, "Times New Roman", Times, serif">
<IFRAME NAME="mainframe" id="mainframe"  FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=580 HEIGHT=100  style="position:relative; left:16px; margin-top:90px;" onload="genurl1('/cgi-bin/nph-gov.cgi')"></IFRAME>
</div>
What im trying to do is make the iframe call a function in main page (which on call assigns a value to a variable.and if that variable is set i can know the page has loaded and if that variable is not set ,the iframe has not loaded)

NOTE:the iframe src is from another domain

I need help on gng about doing this. ...as the iframe src is another domain and will i be able to call a function in in main page thru the iframe..and assign a value.
uniaxaj is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-14-2007, 03:25 PM Re: calling a function in parent page through iframe?
Novice Talker

Posts: 6
Trades: 0
someone told me parent.func() callin may work..
but will parent.functionname() call from an external domain loaded iframe have any impact on the the parent..in which the iframe is called...

hrd thats a javascript bug..and firfefox 2 and IE 7 got a fix for it..
any way get it working..across domains..someone pls help!
uniaxaj is offline
Reply With Quote
View Public Profile
 
Old 08-14-2007, 04:37 PM Re: calling a function in parent page through iframe?
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
but will parent.functionname() call from an external domain loaded iframe have any impact on the the parent
No.

And that for the reason that every navigator out there at this instant prohibit javascript interaction through frames/iframes between 2 different domains.
Your only solution is through AJAX or web services calls between the 2 domains.

Quote:
someone told me parent.func() callin may work
Yes, but again, only if the 2 frames are located on the same domain.
if you have a document, with an iframe, the main document is referred from the iframe via "parent".

If you have frames, parent from any of the 2 frames refer to the frameset. If you want to access the second frame, you must use
Code:
parent.other_frame_name.yourFunction(a_parameter);
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 08-14-2007 at 04:42 PM..
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-15-2007, 01:36 AM Re: calling a function in parent page through iframe?
Novice Talker

Posts: 6
Trades: 0
could some one give me resources or links on ajax cross domain calls. in ASP
uniaxaj is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to calling a function in parent page through iframe?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19517 seconds with 12 queries