Javascript back button for iframe parent window
- by DisgruntledGoat
I have some pages with iframes in them. I want to add a link/button inside the iframe, to make the browser go back one page in history. But I want the PARENT to go back, not the iframe itself.
I originally had this, which makes the iframe page go back (if it exists):
<a href="javascript:history.back()">« Go back</a>
I've tried window.parent.history.back() and window.parent.document.history.back() but neither one works. There are no cross-domain issues accessing the iframe from the parent and vice-versa.