aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes URL in a IFRAME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "URL in a IFRAME" Watch "URL in a IFRAME" New topic
Author

URL in a IFRAME

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

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: 15376
    
    6
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: 2578

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: 2578

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: 15376
    
    6
The headers

Eric
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Which headers? The referer header is returned as null!
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Any pointers here?
 
Don't get me started about those stupid light bulbs.
 
subject: URL in a IFRAME