如何使iframe外部的超级链接的页面在iframe中打开a标签链接


如何使iframe外部的超级链接的页面在iframe中打开a标签链接,有以下两种方法:

 一、html方法:

<iframe name="a1"></iframe>  
<a href="http://www.baidu.com" target="a1">百度</a>

二、javascript方法:
<iframe id="a1"></iframe>  
<a href="http://www.baidu.com"  onclick="document.frames('a1').location=this.href;return false">百度</a>

反过来,如何在父窗口中打开iframe中的链接,有以下四种方法:

一、html方法 2种

<a   href=""   target="_top"></a>  
<a   href=""   target="_parent"></a>  

二、javascript方法 2种

<a   href="#"   onclick=window.parent.location.href=""></a>  
<a   href="#"   onclick=window.top.location.href=""></a>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM