Web Analytics Made Easy -
StatCounter How to change opener from chromeless - CodingForum

Announcement

Collapse
No announcement yet.

How to change opener from chromeless

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    well the one line you have should either be

    window.close();

    or

    sellf.close();
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

    Comment


    • #3
      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...

      Comment


      • #4
        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!·

        Comment


        • #5
          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..

          Comment


          • #6
            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; Jul 8, 2002, 11:34 AM.
            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!·

            Comment


            • #7
              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!

              Comment


              • #8
                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.
                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!·

                Comment


                • #9
                  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

                  Comment


                  • #10
                    Originally posted by giuseppe74
                    p.s. you are waking now? in italy is about evening
                    I'm always trying to wake up!
                    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!·

                    Comment

                    Working...
                    X