如何在同一个 iframe 中打开 iframe 链接? [英] How to open a iframe link within the same iframe?

查看:22
本文介绍了如何在同一个 iframe 中打开 iframe 链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在 iframe 中加载外部服务器 URL,其中有一些链接,当用户点击链接时,它会在 iframe 之外打开.但我想在同一个 iframe 中打开它.

I have to load outside server URL within iframe which has some links, when user clicks on a link it opens outside the iframe. But I want to open it within the same iframe.

怎么可能?

推荐答案

您应该指定 iframe 的目标名称.

You should specify target name of the iframe.

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.w3schools.com" target="iframe_a">www.google.com</a></p>

这篇关于如何在同一个 iframe 中打开 iframe 链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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