我在打开日历应用程序的页面上有一个iframe,在这个应用程序中,我有一些链接是应用程序本身,而其他一些链接应该打开在父窗口中。使用如何只打开父窗口上的iframe中的一些链接
:<base target="_parent" />
使所有的链接在父窗口打开,但我想只是某种联系为目标的父窗口,并不是所有的...
是有可能有一个跨浏览器解?
我在打开日历应用程序的页面上有一个iframe,在这个应用程序中,我有一些链接是应用程序本身,而其他一些链接应该打开在父窗口中。使用如何只打开父窗口上的iframe中的一些链接
:<base target="_parent" />
使所有的链接在父窗口打开,但我想只是某种联系为目标的父窗口,并不是所有的...
是有可能有一个跨浏览器解?
看来你并不真的需要<base>
标签。您可以在这些链接上使用target
属性(<a>
),以使其行为不同。
如果您仍然想使用<base>
,那么对于那些没有target
属性的链接,目标将由<base>
指定。
例如:
<base target="_self"></base>
<a href="http://stackoverflow.com" target="_parent">Open SO in parent window/tab</a>
<br/>
<a href="http://stackoverflow.com" >Open SO in this window/tab</a>
随着该片段打开在父
<base target="_parent" />
<a target="_parent">your link open in the parent</a>
的链路与该片段打开在IFRAME链接本身
<base target="_blank" />
<!-- that should even work without the bank -->
<a target="_blank">your link open in the iframe</a>
这在所有的浏览器
支持你就不能一个目标参数添加到您想要在父框架中打开链接?像<a href="bla.html" target="_parent" />
那些将使页面中的所有链接都指向一个指定的位置... – 2013-05-03 11:40:49
你也可以在'a'标签本身上使用目标 – MatthiasLaug 2013-05-03 11:41:37
为'a'标签添加了一个示例 – MatthiasLaug 2013-05-03 11:43:04