如何使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