简体   繁体   中英

Javascript Tab Reload on button click

I have a page say abc.xhtml and xyz.xhtml. Both are opened at same time, and there is a button in abc.xhtml and when it is clicked, is it possible to reload xyz.xhtml. Can this be achieved using javascript?

If by "both are opened at the same time" you mean in the same browser, than yes. This is achievable by manipulating browser cookies using JavaScript document.cookie property. See Javascript communication between browser tabs/windows for more details.

If you want to change xyz.xhtml that is opened on another client, first client can trigger remote change by comunicating with second client using server in the middle. (If you want to stricly use JavaScript, you can use server-side variant of it, ie nodeJS).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM