1
Next, I have a page that, by clicking on a button, opens a new window. On this new page I would like to put links that affect the page that generated this window.
Someone knows how to do?
1
Next, I have a page that, by clicking on a button, opens a new window. On this new page I would like to put links that affect the page that generated this window.
Someone knows how to do?
1
If the tab is on the same domain you can access the parent page that opened through the window.opener
. If it’s different domains, it will prohibit you from accessing document
in most browsers.
function alteraPaginaPai() {
window.opener.document.getElementById('lbl').innerHTML = "Alteração!!"
}
0
In the two articles listed below you will see how you can thoroughly explore the properties of the object window
in Javascript
Exploring the properties of the window object in Javascript
Advanced operations with Javascript popups
As a brief example, you can use inside the pop-up
or iframe
the window.parent
to be able to access variables and functions from the main browser window.
-1
In the target option you have the options: _Blank _Parent _self _top framename
<a href="http://www.google.com" target="_parent">Visit google.com!</a>
and the one you want is Parent. hope I helped. cumpz
that’s not quite what I wanted. I have window A, which when clicking the button, it generates a report in a new window. links from that report (new window) should affect window A.
I don’t think that can be done. what Voce can do is always use the same page. window A opens link -> window B. in window B opens link to window A... I’m not seeing another way. I hope I helped. may someone know another way! ;)
@LPSANTOS he is quoting javascript as one of tags of the question, therefore it is necessary to evaluate the possibility within this language also. In javascript I can control iframes and pop-ups using the class window
. I already asked if he knows how to use, if he responds negatively I will show him some examples of how to use windows with this class.
ola @Erlon Charles, you’re right, I didn’t even notice the javascript tag, so maybe it’s possible! , I don’t work much with Java. but thanks for the tip!
Browser other questions tagged php javascript html css
You are not signed in. Login or sign up in order to post.
i have window A, which when clicking the button, generates a report in a new window. the links of this report (new window) should affect window A.
– Gustavo Emmel
Knows how to use class
window
javascript?– Erlon Charles
never used. have some examples
– Gustavo Emmel