SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Emegrency.. writing to a window

    I have 2 popup windows... a main one and a child of the main...

    I need to write from the main window to the child.. this is part of a desktop application, so here we go:

    Main File: director.html

    Code:
    <html>
    <head>
    <SCRIPT TYPE="text/javascript">
    <!--//
    function installWindow1()
    {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
        window.menubar.visible     = false;
        window.directories.visible = false;
        window.statusbar.visible   = false;
        window.toolbar.visible     = false;
        window.locationbar.visible = false;
        window.personalbar.visible = false;
        window.scrollbars.visible  = true;
        //window.fullscreen	       = true;
        window.outerWidth          = 840;
        window.outerHeight         = 630;
        window.screenY             = 0;
        window.screenX             = 0;
        //window.innerHeight         = 610;
        //window.innerWidth          = 810;
        netscape.security.PrivilegeManager.disablePrivilege("UniversalBrowserWrite");
        location.href = 'http://localhost/cvideo/director/home.php';
    }
    function installWindow2()
    {
    	day    = new Date();
    	id     = day.getTime();
    	w4     = window.open( 'till.html', id, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=10,height=10');
    }
    function install_window()
    {
        installWindow1();
        installWindow2();
    }
    //-->
    </script>
    </head>
    <body onload="install_window();">
    </body>
    </html>
    Child File (Launched from code above) till.html

    Code:
    <html>
    <head>
    <SCRIPT TYPE="text/javascript">
    <!--//
    function install_window()
    {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite");
        window.menubar.visible     = false;
        window.directories.visible = false;
        window.statusbar.visible   = false;
        window.toolbar.visible     = false;
        window.locationbar.visible = false;
        window.personalbar.visible = false;
        window.scrollbars.visible  = true;
    //  window.fullscreen	       = true;
        window.outerWidth          = 840;
        window.outerHeight         = 460;
        window.screenY             = 300;
        window.screenX             = 185;
        //window.innerHeight         = 610;
        //window.innerWidth          = 810;
        netscape.security.PrivilegeManager.disablePrivilege("UniversalBrowserWrite");
        location.href = 'http://localhost/cvideo/director/till.php';
    }
    //-->
    </script>
    </head>
    <body onload="install_window();">
    </body>
    </html>
    How would I do it? i tried w4.document...... but it says w4 is undefined..

    -Eric
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The 'javascript context' for the variable w4 is the page 'director.html'. But after installWindow1() loads the page 'home.php' the variable w4 no longer exists.

    The page 'home.php' must have its own javascript which gets a reference to the child window. But that is not possible because the 'name' of the window is the time. If the child window's name was known to 'home.php' then it could doc.write to it.

    It looks like there are several different ways to do this.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •