SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Aug 13, 2007, 01:55 #1
- Join Date
- Oct 2006
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
calling a function in parent page through iframe?
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>
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.
-
Aug 13, 2007, 02:39 #2
- Join Date
- Oct 2004
- Location
- Birtley, UK
- Posts
- 2,439
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
iirc
parent.functionname();
-
Aug 13, 2007, 11:46 #3
- Join Date
- Oct 2006
- Posts
- 3
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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!
-
Aug 13, 2007, 12:03 #4
I am not really sure on this but does javascript let the windows/frames from different domains to communicate with each other? I thought there was some sort of 'same domain' policy which prevented that.
-
Aug 14, 2007, 11:27 #5
- Join Date
- Oct 2004
- Location
- Birtley, UK
- Posts
- 2,439
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I don't think there are any hacks to get over this, other than using a server side code ie PHP's cUrl to get the page within the iframe and display it via your own domain.
Bookmarks