Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Rome, Italy
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to change opener from chromeless

    Hello to all,
    i've a chromeless window with a button, when i click on the button i should change the opener page and close the chromeless window.
    I wrote this (i've changed the button):
    <a href="#" onClick="CloseWin();">Close</a>

    and first in the head tags:

    <script type="text/javascript">
    <!--
    function CloseWin(){
    opener.location.href='dettagli.asp';
    window.self.close();
    //-->
    </script>

    but it doesn't work.

    The only things that works is this:
    <a href="javascript:window.self.close();">Close</a>

    How can i change the opener page before close the window?
    Thanks,

    Giuseppe

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    well the one line you have should either be

    window.close();

    or

    sellf.close();

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Rome, Italy
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well...with only window.close() or self.close() it doesn't works, i've to write window.self.close() to works.
    But the problem is that before close i should change the opener page...

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to change opener from chromeless

    Originally posted by giuseppe74


    <script type="text/javascript">
    <!--
    function CloseWin(){
    opener.location.href='dettagli.asp';
    window.self.close();
    //-->
    </script>

    Try this:

    function CloseWin(){
    opener.location.href='dettagli.asp';
    self.focus();
    window.self.close();
    Quíet Storm Designs ~ Art is not what you see, but what you make others see.
    · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    Rome, Italy
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, i will try later, now i haven't with me the files...anyway i remember you that is not a normal popup window but a chromeless window..

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by giuseppe74
    anyway i remember you that is not a normal popup window but a chromeless window..
    Oops. Sorry...

    <SCRIPT>
    function CloseWin(){
    opener.location.href='dettagli.asp';
    self.focus();
    top.close();
    }

    </SCRIPT>
    Last edited by Quiet Storm; 07-08-2002 at 05:34 PM.

  • #7
    New Coder
    Join Date
    Jun 2002
    Location
    Rome, Italy
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok..i've tried on a custom files but..nothing!!!
    This is what i have:

    1st page (that load the popup)

    <html>
    <head></head>


    <script language="javaScript" type="text/javascript" SRC="js/pz_chromeless_2.1.js"></SCRIPT>

    <script>
    function openIT() {
    theURL="attesa.htm" // indirizzo della pagina da aprire
    wname ="attesa" // nome della finestra della pagina da aprire
    W=250; // width
    H=200; // height
    windowCERRARa = "img/close_a.gif" // Queste gif sono i tre stati
    windowCERRARd = "img/close_d.gif" // dell'icona usata per chiudere
    windowCERRARo = "img/close_o.gif" // la finestra
    windowNONEgrf = "img/none.gif"
    windowCLOCK = "img/clock.gif"
    windowREALtit = "  Upload dei files in corso..." // Titolo del task
    windowTIT = "<font face=verdana size=1>&nbsp;&nbsp; Upload dei files in corso...</font>" // titolo della finestra
    windowBORDERCOLOR = "#000000" // colore del bordo
    windowBORDERCOLORsel = "#000000" // colore del bordo selezionato
    windowTITBGCOLOR = "#ff9900" // colore della barra del titolo
    windowTITBGCOLORsel = "#ff9900" // colore della barra del titolo selezionata
    openchromeless(theURL, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
    }
    </script>




    <body>
    <a href="javascriptpenIT();">Open Window</a>
    </body>
    </html>


    Second page (the popup)

    <html>
    <head>
    <SCRIPT>
    function CloseWin(){
    opener.location.href='dettagli.asp';
    self.focus();
    top.close();
    }
    </SCRIPT>
    </head>
    <body>
    <p align=center><a href="#" onClick="CloseWin();">Close</a>
    </body>
    </html>

    I've just copied a script from here:

    http://www.dhtmlshock.com/window-scr...ss/default.asp

    I hope you can help me!

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Re: How to change opener from chromeless

    Last time - this time I checked it.

    <SCRIPT>
    function CloseWin(){
    top.opener.location.href='dettagli.asp';
    self.focus();
    top.close();
    }

    </SCRIPT>

    Sorry, I'm still waking up.

  • #9
    New Coder
    Join Date
    Jun 2002
    Location
    Rome, Italy
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quite Storm you're great!!!
    I've tried on other pages (not mine) but it works great!!!
    Unfortunately i've the chromeless as an asp page, so i have to close this connection and try it on my localhost, but i think it will works witouth problems!
    Really really thanks for the help!!!!

    p.s. you are waking now? in italy is about evening

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by giuseppe74
    p.s. you are waking now? in italy is about evening
    I'm always trying to wake up!


  •  

    Posting Permissions

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