Created
April 23, 2013 05:58
-
-
Save pbojinov/5441137 to your computer and use it in GitHub Desktop.
get the URL of an iframe’s parent page, via Nicholas Zaka's article - http://www.nczonline.net/blog/2013/04/16/getting-the-url-of-an-iframes-parent/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getParentUrl() { | |
var isInIframe = (parent !== window), | |
parentUrl = null; | |
if (isInIframe) { | |
parentUrl = document.referrer; | |
} | |
return parentUrl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment