1

is there a way to have a dynamic link outside an iframe that links to whatever the current iframe page is? I'm having a hard time explaining this, maybe I'm using the wrong words that's why I can't find an answer by searching.

Example - user browses a website within an iframe, but there is a link outside the iframe to take the user to the actual site he's browsing, this is obviously simple enough, my question is how do I make the link to be what the iframe is displaying currently. For example, if the users is on example.com/page12.html in the iframe, but the iframe source is just example.com/ how do I make the link get updated to whatever the current page within the iframe is.

Thank you

Vee
  • 25
  • 5
  • Do `iframe` `.src` and parent `window` `location.href` have same origin? – guest271314 Apr 29 '17 at 20:59
  • Yes you can get it if the domains are the same, see: http://stackoverflow.com/questions/938180/get-current-url-from-iframe – Eeks33 Apr 29 '17 at 22:17
  • The iframe's source is a folder on the same domain. The content of the frame is essentially a forum that's installed in a sub folder on the same domain. – Vee Apr 30 '17 at 21:59

0 Answers0