针对另一个IFrame的IFrame [英] IFrame targeting another IFrame

查看:128
本文介绍了针对另一个IFrame的IFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个iframe的父页面。一个保存导航链接,另一个应该显示与第一个iframe中点击的导航链接有关的信息。所以我需要从另一个iframe中定位一个iframe。这可能吗?如果是的话,一个人怎么办?

I have a parent page containing two iframes. One holds navigation links and the other should display the information pertaining to the navigation link clicked in the first iframe. So I need to target the one iframe from within another iframe.Is this possible? If so how does one go about it?

推荐答案

我想通了。对于那些想知道的人,您需要使用JavaScript来访问父文档元素并更改属性。所以要回答我自己的问题,可以设置onclick链接来运行以下javascript:

I figured it out. For those who want to know, you need to use javascript to access the parent document elements and change the attributes. So to answer my own question, one sets the onclick link to run the following javascript:

parent.document.getElementById('frameName').src = 'page.html';

这篇关于针对另一个IFrame的IFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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