求助,父页面问题,可能需要高手? 刚才写错了:2,由于“目的地址”是变量(要获取页面的数据),所以不能直接用 <a href="目的地址" target=_parent>词典 </a>实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 _top.location.href="目的地址" ; 直接写变量就行了<a href="#" onClick="this.href='目的地址'" target="_parent">词典 </a> <iframe width="200" height="300" src="aa.html"> </iframe>把这个命个名,加个ID<iframe id="indexFrame" ...></iframe><script language="javascript">function gogo(){ parent.location.href="目的地址" ; } </script> 中写成parent.indexFrame.frameElement.src = showUrl;如果出现错误就多测试一下,问题就是获取iframe的问题,parent.indexFrame.frameElement.src 这一句多换一换试下,功能很好实现的! 父页面如下,也就是你说的bb<head> <title>无标题页</title></head><body><iframe id="indexframe" width="200" height="300" src="HTMLPage.htm"></iframe></body></html>子页面1也就是你说的aa<head> <title>无标题页</title> <script type="text/javascript"> function koko() { parent.document.all.indexframe.src = 'HTMLPage2.htm'; alert(parent.document.all.indexframe.src); } </script></head><body> <input id="Button1" type="button" value="button" onmousedown="koko();" /> </body></html>子页面2 ,用来测试的,<html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>无标题页</title></head><body><table><tr><td>fdafdafd</td></tr></table></body></html>测试通过,IE7.0 中,parent.document.all.indexframe.src这个是关键的地方,层次清楚了就可以了,上面的页面代码可以贴的不全,太晚了,要睡觉了 bb.html<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档 </title> </head> <SCRIPT LANGUAGE="JavaScript"> //你这里已经覆盖了window.location对象了,不能在使用location对象来更改url//可以使用document.location对象来更改url.以后命名不要和系统对象同名 var location ="aa"; </SCRIPT> <body> <table width="430" border="0" cellpadding="0" cellspacing="0" > <tr> <td> <iframe width="200" height="300" src="aa.html"> </iframe> </td> </tr> </table> </body> </html> aa.html<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>aa </title> </head> <body> <a href="#" onclick="gogo()">词典 </a> <script language="javascript">function gogo(){ parent.document.location="http://b2b.lvyou168.cn";//使用parent.document.location//parent.locaton.href="目的地址" ; } </script> </body> </html> js内容显示在DIV里面,帮帮忙!!! js加载图片进度条应该怎么写 firefox 中用JAVASCRIPT 请求WEBSERVICE 关于in的用法 求教:关于单击表格某单元格时,全选该单元格内容的脚本! 怎样在网页上加一个按钮,让用户另存本网页? javascript不能在不同的js文件中调用啊? 表格数据编辑 关于import的问题 用innerHTML出来的页面 就不能通过事件句柄调用函数了吗??? js里bordercolor设置不起作用该如何修改? 请教mztree问题
<a href="#" onClick="this.href='目的地址'" target="_parent">词典 </a>
parent.location.href="目的地址" ;
} </script> 中写成parent.indexFrame.frameElement.src = showUrl;如果出现错误就多测试一下,问题就是获取iframe的问题,parent.indexFrame.frameElement.src 这一句多换一换试下,功能很好实现的!
<head>
<title>无标题页</title>
</head>
<body>
<iframe id="indexframe" width="200" height="300" src="HTMLPage.htm"></iframe>
</body>
</html>子页面1也就是你说的aa
<head>
<title>无标题页</title>
<script type="text/javascript">
function koko()
{
parent.document.all.indexframe.src = 'HTMLPage2.htm';
alert(parent.document.all.indexframe.src);
}
</script>
</head>
<body>
<input id="Button1" type="button" value="button" onmousedown="koko();" />
</body>
</html>子页面2 ,用来测试的,
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
</head>
<body>
<table><tr><td>fdafdafd</td></tr></table>
</body>
</html>
测试通过,IE7.0 中,parent.document.all.indexframe.src这个是关键的地方,层次清楚了就可以了,上面的页面代码可以贴的不全,太晚了,要睡觉了
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
</head>
<SCRIPT LANGUAGE="JavaScript">
//你这里已经覆盖了window.location对象了,不能在使用location对象来更改url
//可以使用document.location对象来更改url.以后命名不要和系统对象同名
var location ="aa";
</SCRIPT>
<body>
<table width="430" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td> <iframe width="200" height="300" src="aa.html"> </iframe> </td>
</tr>
</table>
</body>
</html> aa.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>aa </title>
</head>
<body>
<a href="#" onclick="gogo()">词典 </a>
<script language="javascript">function gogo(){
parent.document.location="http://b2b.lvyou168.cn";//使用parent.document.location
//parent.locaton.href="目的地址" ;
} </script>
</body>
</html>