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


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

 一、html方法:

 

<iframe name="a1"></iframe>  
<a href="http://www.lingdublog/" target="a1">零度博客</a>

二、javascript方法:

<iframe id="a1"></iframe>  
<a href="http://www.lingdublog.cc"  onclick="document.frames('a1').location=this.href;return false">零度博客</a>

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

一、html方法

1、

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

2、

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

二、javascript方法

 1、

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

2、

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

 


免责声明!

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



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