简体   繁体   English

父iframe中的按钮在iframe中单击

[英]Button in parent iframe click inside iframe

i'm trying to make a nav bar with the contents below in an iframe and i'm wanting the nav bar buttons when clicked to load a page in the lower iframe. 我正在尝试在iframe中使用下面的内容制作导航栏,并且我想在单击以在较低的iframe中加载页面时使用导航栏按钮。

The iframe and main page will be on the same server // domain, so i was wondering if anyone could recommend something ? iframe和主页将位于同一服务器上//域,因此我想知道是否有人可以推荐一些东西?

I had a lil Google and found this: iframe click link it opens in parent page rather than in iframe page 我有一个小Google,发现了这一点: iframe点击链接会在父页面而非iframe页面中打开

and tried changing parent to child but it didn't work. 并尝试将父母改为孩子,但没有成功。

Considering an iFrame with name attribute of foo . 考虑一个name属性为foo的iFrame。

<iframe name="foo" src="index.html"></iframe>

Use a link with target foo . 使用与目标foo的链接。

<a href="about.html" target="foo">About</a>

Should work as expected. 应该能按预期工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM