javascript: Get parent window location href from an iFrame

February 22nd, 2010 by jeremychone

Assuming the iframe is from the same domain that the top window, use frameElement.ownerDocument to get to the parent document.

var topWindowHref = window.frameElement.ownerDocument.location.href

Leave a Reply