问题
I have a parent page containing two iframes. One holds navigation links and the other should display the information pertaining to the navigation link clicked in the first iframe. So I need to target the one iframe from within another iframe.Is this possible? If so how does one go about it?
回答1:
I figured it out. For those who want to know, you need to use javascript to access the parent document elements and change the attributes. So to answer my own question, one sets the onclick link to run the following javascript:
parent.document.getElementById('frameName').src = 'page.html';
来源:https://stackoverflow.com/questions/2334541/iframe-targeting-another-iframe