Results 1 to 1 of 1
Thread: reading parent URL from iframe
Aug 23, 2007, 17:07 #1
- Join Date
- Aug 2004
- Los Feliz, CA
- 0 Post(s)
- 0 Thread(s)
reading parent URL from iframe
I have been fighting with this bloody stuff all day today - no real effects at all. Grrr.....
I have two URL (two kinds, that is):
1. that hosts main script/file (i.e. www.aaa.com/folder/content.html)
2, 3, 4 so on that display this script on their domain via iframe (i.e. www.yyy.com/folderWithIframe/index.html - with iframe's src=www.aaa....content.html)
Now, I need to print out both URLs in iframed file:
www.aaa.com/folder/content.html - self
or whatever other sites are linking to host script.
But the Parent url is NOT displayed.
To display host's one, I use window.location.href, for the other one parent.location.href.
And, url of content.html is always displayed (of course), but the parent url ONLY if the script is on the same server (same url).
So if I have:
www.yyy.com/folderWithIframe/index.html (with iframe's src=www.yyy....content.html) both URLs are displayed.
If URLs are different (which is the purpose of that bloody thing), parent one is not displayed. What on earth am I doing wrong?
Can anyone help me out here?
(hope I made some sense with the above).