Skip to content

Instantly share code, notes, and snippets.

@beckettkev
Last active March 18, 2016 16:50
Show Gist options
  • Select an option

  • Save beckettkev/ec4305e7c29227e148ee to your computer and use it in GitHub Desktop.

Select an option

Save beckettkev/ec4305e7c29227e148ee to your computer and use it in GitHub Desktop.
How to get Parent frames location from within a page called using the SP.UI.Dialog
function getParentWindowLocation() {
document.domain = 'sharepoint.com';
var caller = '';
['protocol','//','hostname','pathname'].forEach(function(item, i) {
caller += item === '//' ? item : window.parent.location[item];
});
return caller;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment