| Author |
URL in a IFRAME
|
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
Let's say I have a struts action at http://xyz.com/someAction.do and this URL is referred from one IFRAME via "src" attribute of IFRAME. Is it possible for me to detect inside someAction.do which page is embedding it in an IFRAME? How can I do this? - Manish
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
As long as the page is in your same domain, you can look into using document.getElementById("iframeId").location.href Eric
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
|
The page will be on another host. Is there anything I can do in the struts action itself?
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
Let me put question in a different way, if I refer to Google API with this - How does it know that the request is coming from domain xyz.com? It is not purely based on the key - if I send same key from another domain, it doesn't work! So how can I do that? TIA, - Manish
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
The headers Eric
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
|
Which headers? The referer header is returned as null!
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2573
|
|
|
Any pointers here?
|
 |
 |
|
|
subject: URL in a IFRAME
|
|
|