Is-it possible to write in a mother window from a child window ?

Discussion in 'Javascript' started by orion30, Apr 24, 2005.

  1. orion30

    orion30 Guest

    Is-it possible to write in a mother window from a child window ?
    Like this:
    Parent.document.write(............................................)
     
    orion30, Apr 24, 2005
    #1
    1. Advertising

  2. orion30

    Grant Wagner Guest

    "orion30" <> wrote in message
    news:426bc0bb$0$18774$...
    > Is-it possible to write in a mother window from a child window ?
    > Like this:
    > Parent.document.write(............................................)


    Why not try it and report back to us whether it worked or not?

    <script type="text/javascript">
    window.newWindowHtml = [
    '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
    '<html>',
    '<head>',
    '<title>Test Window</title>',
    '</head>',
    '<body onload="opener.document.write(\'hi there\');">',
    '</body>',
    '</html>'
    ].join('\n');
    window.open('javascript:eek:pener.newWindowHtml');
    </script>

    Apparently it does work.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
     
    Grant Wagner, Apr 28, 2005
    #2
    1. Advertising

  3. Grant Wagner wrote:

    > <script type="text/javascript">
    > window.newWindowHtml = [
    > '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
    > '<html>',
    > '<head>',
    > '<title>Test Window</title>',
    > '</head>',
    > '<body onload="opener.document.write(\'hi there\');">',
    > '</body>',
    > '</html>'
    > ].join('\n');
    > window.open('javascript:eek:pener.newWindowHtml');
    > </script>
    >
    > Apparently it does work.


    However it should not :) You forgot to escape the ETAGO delimiters, hence
    it is not Valid HTML. And one also should specify the system identifier
    in a DOCTYPE declaration rather than either assuming the UA will use a
    reference file or force it into Quirks/Compatibility Mode. It would be
    also useful to specify the default scripting language for event handler
    attributes no matter if some UAs tested with do not care about that.


    PointedEars
     
    Thomas 'PointedEars' Lahn, May 25, 2005
    #3
    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. bhchng
    Replies:
    0
    Views:
    685
    bhchng
    Jan 13, 2004
  2. Sebastien
    Replies:
    1
    Views:
    572
    Michael Borgwardt
    Nov 7, 2003
  3. Jeff Rodriguez
    Replies:
    23
    Views:
    1,200
    David Schwartz
    Dec 9, 2003
  4. Blue®
    Replies:
    4
    Views:
    912
    Blue®
    Sep 27, 2003
  5. Spammay Blockay
    Replies:
    1
    Views:
    528
    Dietmar Meier
    Feb 4, 2005
Loading...

Share This Page