亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How do the JS of two pages call each other?
迷茫
迷茫 2017-05-16 13:20:36
0
10
752

Now there are two pages. I want to click OK on the left page to refresh the right page. These two pages are at the same level. How to implement this?

迷茫
迷茫

業(yè)精于勤,荒于嬉;行成于思,毀于隨。

reply all(10)
伊謝爾倫

Put this code on the page:

window.onstorage=function(e){
    location.reload();
}

aPage code:

<button onclick="change()">刷新</button>

function change(){
    localStorage.time=new Date().getTime();
}
黃舟

If it is two sub-pages under a parent page, it can be achieved

迷茫

This should not be possible. I think your requirement should be for the server to actively push messages, such as using websocket

Peter_Zhu

Listening to your expression, it sounds like that. Click on the left menu bar to load the back page.
A common and simple method is to nest an iframe on the back side. Of course, the other way is to use pajax

伊謝爾倫

No matter how I think about it, I feel that this is a side navigation, like the one that many people have with a navigation bar on the left or right side of their blog. The other one is the iframe mentioned above. After speaking, the Sheriff returns the votes!

Ty80

This doesn’t work. Each page of the browser has a different interface, and it does not provide js with an interface for communication. If two pages need to interact, the most feasible way is websocket.

世界只因有你

https://zhuanlan.zhihu.com/p/...

左手右手慢動作

From what you said, you used the frame code to introduce different pages.
<FRAMESET cols = "280,*" frameborder=yes bordercolor=silver>

     <FRAME SRC="modifyMenu!showTreeMenu" NAME="menuTree" SCROLLING="No" id="leftTree">  
     <FRAME SRC="showModifyMenu.jsp" NAME="main" SCROLLING="AUTO" id="showModifyMenu">  

lt;/FRAMESET>

function init(){

//leftTree是左邊Frame的id  
//重新加載這個頁面  
window.parent.frames[ "leftTree"].location.reload();  

}

You can try this method.

phpcn_u1582

It sounds like a nested iframe page. . .

迷茫

兩個打開的窗口是兩個運行環(huán)境吧,這能實現(xiàn)?求大神打臉~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template