Reputation: 20
I am using a free site. that free site has a free app. In that free app I can run PHP code from my server.
What JavaScript code can get me the URL of the address showing in browser called from an iframe on my server?
Thanks -Ed
Upvotes: 0
Views: 2430
Reputation: 5167
If I understand you right, you want to get the URL of the main window from the iframe. If so (from the page in the iframe):
window.parent.location.href
NB: Security policies on browsers will not allow you to access the this property if the main window and the iframe are accessed on different domains.
Upvotes: 6