Communicating Back to Main Window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chauz

    Communicating Back to Main Window

    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_f rame.sp_text_co rredor.innerTex t = "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


  • DU

    #2
    Re: Communicating Back to Main Window

    chauz wrote:[color=blue]
    > 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_f rame.sp_text_co rredor.innerTex t = "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.
    >[/color]

    sp_text_corredo r is what? A paragraph? An input?

    Try

    function f_close()
    {
    opener.corredor _frame.sp_text_ corredor.childN odes[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
    [color=blue]
    > I'm very newbie with Javascript, it seems like i'm using some "only" IE
    > code,[/color]

    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.[color=blue]
    >
    > Any help would be appreciated
    >
    >[/color]

    Can you provide an url?

    DU

    Comment

    Working...