0

I have one iframe within parent page. People can navigate using iframe page. When parent page is refreshed iframe content reloads original src . What I need is when parent page is refreshed to refresh iframe too, but not the original src but what may be on the page on that very moment. Maybe someone has a better solution.

Thank you

marius
  • 329
  • 1
  • 2
  • 16
  • 1
    I'm not sure if this is possible, but you might be able to do something with cookies. If you can store/update the URL of the framed page every time it changes, and then load the iframe based on that stored URL when the page loads, that would probably do the trick. – Ben Barden Mar 29 '13 at 12:42

1 Answers1

1

You cannot do that as when parent page is refreshed, whole HTML along with original IFrame SRC will be returned from the server.

The only way to do so is, store the new SRC of IFrame in Cookies or Server Session and while serving the parent page from server, get this Cookie/Server Session value and based on that load the IFrame

Amit
  • 1,365
  • 8
  • 15
  • 1
    http://stackoverflow.com/questions/2429045/iframe-src-change-event-detection for the listener to tell you when the iframe changes src. – Ben Barden Mar 29 '13 at 12:46
  • @marius if this is has successfully answered your question, it is polite to acknowledge it by clicking on the green check-mark next to the answer. – Ben Barden Mar 29 '13 at 16:32
  • @marius I got a lot from community and I have just started giving it back, if you wish to accept answer, you can do so. I don't mind if you do not accept the answer. – Amit Apr 01 '13 at 08:01