一個網頁裡有2個IFRAME
<iframe id="main" src="main.aspx" scrolling="auto"></iframe>
<iframe id="login" src="login.aspx" scrolling="no"></iframe>
上面2個Iframe在IFrame 'main'中(即main.aspx中)有個按鈕mybutton如何通過點mybutton實現iframe 'login'的src變換成'out.aspx'???????????????
http://community.csdn.net/Expert/topic/3987/3987407.xml?temp=.8924677
<iframe id="main" src="main.aspx" scrolling="auto"></iframe>
<iframe id="login" src="login.aspx" scrolling="no"></iframe>
上面2個Iframe在IFrame 'main'中(即main.aspx中)有個按鈕mybutton如何通過點mybutton實現iframe 'login'的src變換成'out.aspx'???????????????
http://community.csdn.net/Expert/topic/3987/3987407.xml?temp=.8924677
--注意mybutton是在main.aspx
上的,而不是在當前2個IFrame的外面
function onclick()
{
self.parent.frames["login"].document.location.href = "out.aspx";
}在mybutton的onclick事件中绑定这个函数
onclick = "onclick();";
就行啦
<iframe id="main" src="main.aspx" scrolling="auto"></iframe>
<iframe id="login" src="login.aspx" scrolling="no"></iframe>
上面2個Iframe
在main.aspx裡面有個按鈕mybutton(---而不是說mybutton 在index上)
如何實現點main裡的mybutton 來設置
第2個的iframe地址(src)跳轉倒"out.aspx"
大家都沒理解清楚啊
看代碼<head></head>裡面
<script>
function onclick()
{
self.parent.frames["login"].document.location.href = "web\\main.aspx";
}
</script>
<asp:Button ID="mybutton" Runat="server" Text="轉換" OnClick= "onclick();"
></asp:Button>