以前csdn中的一个帖子
问题:
比如 我要在A页 点击一个按钮。。当前页就打开B页。。而B页是一个框架页。。 有一个框架C。。我要让框架C里显示页面D。。怎么办到。。
回答:
问题:
比如 我要在A页 点击一个按钮。。当前页就打开B页。。而B页是一个框架页。。 有一个框架C。。我要让框架C里显示页面D。。怎么办到。。回答:
如果A页以:B.aspx?id=xxx.aspx方式跳转到B页的话:
B页:
==
<script>
function test()
{
var c=document.getElementById("c");
var s=top.location.href.split('=').pop();
if(s!=top.location.href)
c.src=s;
else
c.src='d.aspx';
}
</script>
<body onload='test()'>
.
<iframe id="c"></iframe>
.
楼主结贴:B页:
==
<script>
function test()
{
var c=document.getElementById("c");
var s=top.location.href.split('=').pop();
if(s!=top.location.href)
c.src=s;
else
c.src='d.aspx';
}
</script>
<body onload='test()'>
.<iframe id="c"></iframe>
.我已经使用纯JAVASCRIPT 实现了此功能。。而且很简单。。
今天无意中又看到了,呵呵。难道我的答案不够纯JAVASCRIPT
浙公网安备 33010602011771号