For a script running in an iframe, use parent.location.href , although an iframe served from another domain to its parent page will not be able to access it.
If you are in different domains, there are several alternative methods that should work for you. In particular, using window.name to transfer data or stack an iframe inside iframes. Both etc. Listed in this slide show . Window.name is mentioned on slide 31. Especially check slide 34 onwards for the iframe stacking method, which will allow bi-directional communication between different source frames.
source share