在iframe中打开链接 [英] open link in iframe
本文介绍了在iframe中打开链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望链接在点击时打开框架中的页面。
我有一个带有框架的页面,框架下面有一些链接。 。
我试过< a href =target =nameofframe> link1< / a>
但它没有奏效?
更新
它是一个iframe。
< / p> a href =http://www.google.comtarget =myIframe>链接文字< / a>
您也可以使用Javascript完成此操作。 iFrame具有一个src属性,用于指定它显示的位置。因此,将链接的点击绑定到更改该src属性是一件简单的事情。
I have a page with a frame in it, and some links below the frame.
I want the links, when clicked, to open the page in the frame.
I tried <a href="" target="nameofframe">link1</a>
but it didnt' work?
update its an iframe.
解决方案
Assuming the iFrame has a name attribute of "myIframe":
<a href="http://www.google.com" target="myIframe">Link Text</a>
You can also accomplish this with the use of Javascript. The iFrame has a src attribute which specifies the location it shows. As such, it's a simple matter of binding the click of a link to changing that src attribute.
这篇关于在iframe中打开链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文