I have a parent popup and a child popup and I want to pass one array to the parent popup using Javascript. I tried everything but it's not working at all. What should I do here?
The code below does nothing. I want to put the value of ret into the parent window.
var ret = new Array(Number(txtfolioID.value), txtfolioName.value);
var opener = window.opener;
if (opener) {
opener.setFolio(Number(txtPortfolioID.value), txtPortfolioName.value);
}
Parent aspx page
window.setFolio = function (folioID, folioName) {
document.getElementById("txtPortfolio").value = folioName;
};
Console Error
firebug-lite.js:11885 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
EDIT I changed the code completely and now I am checking that element exists in DOM or not.
var folio = window.parent.document.getElementsByName("txtPortfolio");
folio.value = 'somevalues';
but I am not able to assign the value the textbox.please help