Communicating Back to Main Window

Discussion in 'Javascript' started by chauz, Nov 27, 2003.

  1. chauz

    chauz Guest

    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
     
    chauz, Nov 27, 2003
    #1
    1. Advertising

  2. chauz

    DU Guest

    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
     
    DU, Nov 27, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay
    Replies:
    8
    Views:
    6,628
    livshitz
    Jun 12, 2011
  2. =?Utf-8?B?R2FyeQ==?=
    Replies:
    1
    Views:
    513
    =?Utf-8?B?R2FyeQ==?=
    Nov 11, 2005
  3. Bhishm
    Replies:
    2
    Views:
    802
    bruce barker
    Sep 3, 2007
  4. Pealy
    Replies:
    2
    Views:
    182
    Pealy
    Apr 23, 2004
  5. Robert Oschler
    Replies:
    1
    Views:
    400
Loading...

Share This Page