如何调用父窗口函数改变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()">Google</a> parent.html HTML code<body><iframe name="main" src="test.html"></iframe></body><script>function a(){ window.frames["main"].location.href="http://www.google.com"}</script>son.html HTML code<a href="javascript:void(0)" onclick="parent.a()">dfeokrfep</a>试试这样行不行 jsp下拉框option 问题 EXTJS中选项卡的问题 鼠标移出时候,停一段时间,在隐藏,如何实现?? 一段简单的JS数组问题 请问一个jquery语句 求检测最后一个字符不能为“,”,谢谢回答~ 如何做一个右键菜单,并在一个菜单项中运行一个自编的JavaScript的函数? document.styleSheets[0]出错 如何做到點激IE的推出按鈕﹐彈出確定或則取消的提示﹐讓擁護確認? 局域网里面的域信任该如何设置? JS里面包含有JS。 在C#中实现图片轮显中的JS代码
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()">Google</a>
<body>
<iframe name="main" src="test.html"></iframe>
</body>
<script>
function a()
{
window.frames["main"].location.href="http://www.google.com"
}
</script>son.html HTML code
<a href="javascript:void(0)" onclick="parent.a()">dfeokrfep</a>
试试这样行不行