Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Created April 23, 2013 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbojinov/5441137 to your computer and use it in GitHub Desktop.
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/
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