开发者

How do I load parent page with <iframe loading childB.html> from the grandchildren page

开发者 https://www.devze.com 2022-12-10 19:50 出处:网络
I have a parent.html, inside it, there was a iframe. When user tigger anchor link A or B, the iframe will load either childA.html or childB.htm开发者_JAVA百科l

I have a parent.html, inside it, there was a iframe. When user tigger anchor link A or B, the iframe will load either childA.html or childB.htm开发者_JAVA百科l

And inside childB.html, there was a anchor link to grandchildren.html.

Currently my problem is, whenever I click the link at grandchildren.html to return to parent.html, iframe is showing childA.html

How should i do, if I want to show childB.html in iframe instead of showing childA.html

Thanks in advance

Kong


Add a parameter to your parent html. E.g., ?child=A. In the body stmt, add onload=init(). In the init() javascript, parse window.location.search looking for "child" and then do the same switching of the iframe source that you already do.

0

精彩评论

暂无评论...
验证码 换一张
取 消