By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,196 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

Communicating Back to Main Window

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
DU
chauz wrote:
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

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.