How to refresh another page using javascript without opening the same page in a new tab

Is it possible to refresh a page from another page using Javascript or JQuery without opening the same page in a new tab.

JS:

 var newtab = window.open('http://localhost:8081/app/home');
 newtab.document.location.reload(true);

I tried this, but here it will open a new tab with the same page that is already open in the browser.

Please suggest a method.

+4
source share
2 answers

Question, Object Reference, , , 2 . , , :

HTML:

<a onclick="openNewTab()">app2</a>

<a onclick="refreshExistingTab">Refresh</a>

JS:

<script>

    var childWindow = "";
    var newTabUrl="http://localhost:8081/app/home";

    function openNewTab(){
        childWindow = window.open(newTabUrl);
    }

    function refreshExistingTab(){
        childWindow.location.href=newTabUrl;
    }

</script>
+2
+1

All Articles