...

View Full Version : How to change opener from chromeless



giuseppe74
07-08-2002, 04:37 PM
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

A1ien51
07-08-2002, 04:44 PM
well the one line you have should either be

window.close();

or

sellf.close();

giuseppe74
07-08-2002, 04:49 PM
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...

Quiet Storm
07-08-2002, 05:14 PM
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();

giuseppe74
07-08-2002, 05:19 PM
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..

Quiet Storm
07-08-2002, 05:31 PM
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>

giuseppe74
07-08-2002, 05:47 PM
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="javascript:openIT();">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-scripts/Chromeless/default.asp

I hope you can help me! :)

Quiet Storm
07-08-2002, 06:21 PM
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. ;)

giuseppe74
07-08-2002, 07:19 PM
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 :)

Quiet Storm
07-09-2002, 02:26 AM
Originally posted by giuseppe74
p.s. you are waking now? in italy is about evening :)

I'm always trying to wake up! :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum