I have a page in which I run a window, what I want to do is communicate the parent window with the child (send information from the father to the child), I did tests before implementing it and it worked correctly.
what I did was declare a variable in which I stored the variable ( var miVentana = window.open.....
), and it was assigned correctly and passed information from father to son without problems.
Passing the code to implement it on the page stopped working and does not assign the variable window.opener
.
Currently I modify my code to store it in localStore.setItem('nombrevar','valor')
and if it is saved but since I use the JavaScript variable it recognizes me as an object and I can not use window.opener
var miVentana;
function abrirHijo()
{
miVentana = window.open("indexDesarrolloContenido.php", "popupId", "location=no, menubar=no, titlebar=no, resizable=no, toolbar=no, menubar=no, width=500, height=500");
sessionStorage.setItem("miVentana", miVentana);
}
.....
.....
var data = sessionStorage.getItem('miVentana');
data.document.getElementById('contenedorHijo').innerHTML=msg;
Any recommendations about my code?