在父框架中从iframe中打开锚标签 [英] Opening anchor tag from iframe in parent frame

查看:99
本文介绍了在父框架中从iframe中打开锚标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定以下HTML,iframe中的定位标记是否可以定位到父窗口?

Given the following HTML, is it possible for the anchor tag in the iframe to target the parent window?

<div>
  <iframe src="/pageview.html"></iframe>
</div>

iframe(pageview.html)内容:

iframe (pageview.html) content :

<a href="http://www.google.com">link</a>


推荐答案

您需要 target 属性

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

使用 _parent 会将帧的直接父级窗口。要定位顶部窗口,请使用 _top

Using _parent will target the frame's immediate parent window. To target the top window, use _top.

这篇关于在父框架中从iframe中打开锚标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆