如何调用父窗口函数改变iframe的src 如果在parent.html中是使用window.open('son.html')打开子页面, 那么在son.html中调用: window.opener.a(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 尝试一下,把这个去掉:【void(0)】,看代码吧test.html<body bgcolor=black><a href="javascript:top.a(self)">dfeokrfep</a></body>parent.html<script>function a(ifa){//alert(ifa); ifa.location.href="http://www.google.com";}</script><body><iframe id="main" src="test.html"></iframe><br><a href="javascript:a(main)">dfeokrfep</a></body>经过测试,成功,呵呵 把函数移动到子页面。parent.html <body><iframe name="main" src="test.html"></iframe></body>test.html<script>function a(){ self.parent.window.frames["main"].location.href="http://www.google.com"}</script><a href="javascript:void(0)" onclick="a()">dfeokrfep</a> <iframe name="main" src="test.html"></iframe>------------------test.html 是son.html吧。 2个脚本冲突的问题 。 放在一起只有一个有效 求教,如何使用自己编写的浏览器插件(.so格式),分不够再加 刚到新公司熟悉源码,看到一个写法 求教 100分求助求助? js自动完成功能,如何可以选择之中的多个值 insertbefore相反作用? 复选框选择判断问题? 如何用超链接提交表单,提交到一个新窗口? 怎么样可以将导航条置于鼠标点击的坐标位置? 有没有办法实现一个真实的弹出窗口(请看条件) 如何点击按钮后改变鼠标图案 我把一个比较长的字符串放在input里面,post后第二个页面request只取到半截,应该没做长度限制,怎么回事?
test.html
<body bgcolor=black>
<a href="javascript:top.a(self)">dfeokrfep</a>
</body>parent.html
<script>
function a(ifa)
{
//alert(ifa);
ifa.location.href="http://www.google.com";
}
</script>
<body>
<iframe id="main" src="test.html"></iframe>
<br>
<a href="javascript:a(main)">dfeokrfep</a>
</body>经过测试,成功,呵呵
parent.html
<body>
<iframe name="main" src="test.html"></iframe>
</body>test.html<script>
function a()
{
self.parent.window.frames["main"].location.href="http://www.google.com"
}
</script><a href="javascript:void(0)" onclick="a()">dfeokrfep</a>
------------------
test.html 是son.html吧。