Communicating Back to Main Window

C

chauz

hi, i can't get a child window communicate Back to the Main Window
This is my code:

var win1 = window.opener;
function f_close()
{
win1.corredor_frame.sp_text_corredor.innerText = "change this value";
window.close();
}

corredor_frame is the frame where the child window was opened, my problem is
this doesn't work with Mozilla , i got "win1.corredor_frame has no
properties" error, instead it works fine with IE.

I'm very newbie with Javascript, it seems like i'm using some "only" IE
code, but i can't find the standar way.

Any help would be appreciated
 
D

DU

chauz said:
hi, i can't get a child window communicate Back to the Main Window
This is my code:

var win1 = window.opener;
function f_close()
{
win1.corredor_frame.sp_text_corredor.innerText = "change this value";
window.close();
}

corredor_frame is the frame where the child window was opened, my problem is
this doesn't work with Mozilla , i got "win1.corredor_frame has no
properties" error, instead it works fine with IE.

sp_text_corredor is what? A paragraph? An input?

Try

function f_close()
{
opener.corredor_frame.sp_text_corredor.childNodes[0].nodeValue =
"change this value";
window.close();
}

I'm pretty sure I could figure out your problem if only I could see the
whole code.

DU
I'm very newbie with Javascript, it seems like i'm using some "only" IE
code,

innerText is IE only. childNodes[index].nodeValue is DOM and is well
supported by W3C DOM 2 compliant browsers (and that includes MSIE 6 for
Windows). Any DOM 2 CharacterData compliant browser will also support
childNodes[index].data or childNodes[index].nodeValue as long as the
targeted node is of type TEXT_NODE.

Be careful with Mozilla-based browsers as white spaces count as TEXT_NODE.

but i can't find the standar way.
Any help would be appreciated

Can you provide an url?

DU
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top