简体   繁体   中英

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.

The iframe and main page will be on the same server // domain, so i was wondering if anyone could recommend something ?

I had a lil Google and found this: iframe click link it opens in parent page rather than in iframe page

and tried changing parent to child but it didn't work.

Considering an iFrame with name attribute of foo .

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

Use a link with target foo .

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

Should work as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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