Reputation: 10407
Is there anyway to detect if a user clicks a link inside of an iframe if the iframe is not on the same domain as the parent page?
EDIT: I don't have access to the iframed page. I only own the parent window.
Upvotes: 0
Views: 738
Reputation: 7334
No. Due to the javascript same-origin policy, you cannot access any members of the iframe's DOM if the iframe did not serve from the same domain as the page on which your javascript is running.
Upvotes: 1
Reputation: 69905
Try this.
var isInSameDomain = (window.location.host == window.parent.location.host);
Upvotes: 0