Link to edit another open window

1

Next, I have a page that, when you click a button, opens a new window. In this new page I would like to put links that affect the page that generated this window.

Does anyone know how to do it?

    
asked by anonymous 02.03.2015 / 18:56

3 answers

1

If the tab is in the same domain you can access the parent page that opened through window.opener . If it's different domains it will forbid you from accessing document in most browsers.

function alteraPaginaPai() {
    window.opener.document.getElementById('lbl').innerHTML = "Alteração!!"
}
    
07.06.2015 / 22:13
0

In the two articles below you will see how you can drill down into the properties of the window object in JavaScript

Exploring the properties of the window object in JavaScript

Advanced operations with Javascript popups

strong>

As a brief example, you can use within pop-up or iframe window.parent to access variables and functions from the main browser window.

    
02.03.2015 / 20:37
-1

In the target option you have the following options: _blank _parent _self _top framename

<a href="http://www.google.com" target="_parent">Visit google.com!</a> 

And what you want is parent. Hope this helps. cumpz

    
02.03.2015 / 19:03