成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

瀏覽:157日期:2023-02-17 18:44:57

問題描述

1,我的頁面結(jié)構(gòu)是這樣的:

<frameset rows='72,*,16' border='1' framespacing='0' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'> <frame name='framHeader' src='http://m.piao2010.com/wenda/top.aspx' scrolling='no' border='0' frameborder='no' noresize topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'></frame> <frameset name='framMain' cols='250,*' border='0' frameborder='0' framespacing='1' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'><frame name='framLeft' src='http://m.piao2010.com/wenda/Left.html' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' noresize></frame><frame name='framRight' src='http://m.piao2010.com/wenda/right.html' frameborder='0' bordercolor='#e4e4e4' noresize></frame> </frameset> <frame name='framFooter' src='http://m.piao2010.com/wenda/foot.html' marginwidth='0' marginheight='0' frameborder='no' scrolling='no' noresize></frameset> <noframes></noframes>

2,登錄后framRight跳轉(zhuǎn)到welcome.aspx,現(xiàn)在想在welcome.aspx中刷新top.aspx,以便使得登錄名可以顯示在top.aspx中但是怎么弄都無效,求高手幫助。我的寫法:登錄后在welcome.aspx中:

<p> <script>document.getElementsByName('framHeader').window.location.reload(); </script></p>javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

樓下各位的方法我都試過了,都不好用啊。。。。。

javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

javascript - 前端frame重新reload,為什么一直報(bào)沒有l(wèi)ocation這個(gè)方法?

問題解答

回答1:

問題終于解決:

<script>

window.parent.parent.frames['framHeader'].window.location.reload();

</script>樓上各位提供的方法是基于當(dāng)前頁面和要刷新的頁面同處于一個(gè)frameset,而我的這個(gè)頁面不在當(dāng)前frameset所以無法跨域刷新,必須找到目標(biāo)頁面所在的frameset才可以。

回答2:

document.getElementsByName('framHeader')[0].window.location.reload();

回答3:

getElementsByName 同學(xué),請仔細(xì)讀方法名喲

回答4:

document.getElementsByName('framHeader')獲得的是一個(gè)數(shù)組

回答5:

可以嘗試一哈這條語句document.getElementsByTagName(’framHeader’)[0].contentWindow.location.reload();

回答6:

叫你用那么多 jquery,getElementsByName 返回是數(shù)組

標(biāo)簽: JavaScript