PDA

View Full Version : is there anyway to place a "close window" code without getting the alert?


darkannie
03-19-2003, 03:58 AM
i have a VERY legitimate reason for this which i have no use in disclosing. i just want to know if it's possible. thanx for replying.


Lavonne

justame
03-19-2003, 04:07 AM
Originally posted by darkannie

i just want to know if it's possible. thanx for replying.


Lavonne

dar...
/me just a thinks® qui just a once® posted how to do it with...
application/x-oleobject
sooo to just a nswer® your question??? yes /me guesses it isss possible...:O)))

beetle
03-19-2003, 04:12 AM
Ya, there's a hack for it, but it doesn't work on all browsers

F.N.G.
03-19-2003, 04:26 AM
I ran across this link, somewhere in these forums, a while back:

You Can't Do That On The Web (http://www.aspalliance.com/peterbrunone/impossible.asp)

maybe that would work?

beetle
03-19-2003, 04:36 AM
Originally posted by F.N.G.
I ran across this link, somewhere in these forums, a while back:

You Can't Do That On The Web (http://www.aspalliance.com/peterbrunone/impossible.asp)

maybe that would work? That's the hack of which I speak, and it was probably me that posted it :D

darkannie
03-19-2003, 05:55 AM
i know how to close the window, i just want it to automatically close upon clicking the link without getting that alert that allows them to make the choice of closing or not closing. now, that alert only comes up when you use it to close regular browser windows. and i can't turn sed page into a pop-up cuz it's my homepage. all i want is just to close the window when someone clicks; to close automatically. i don't want that piddly alert coming up. just an automatic close upon clicking. that's all. click: "POOF," gone. that's what i was referring to. sorry about being so vague.

Trying again,
Lavonne

glenngv
03-19-2003, 06:16 AM
did you care to read the link that F.N.G. posted? that's exactly what you're looking for!

darkannie
03-19-2003, 08:19 AM
the code opens one window while the other closes. now, i could find a use for that but one, the one who offered the script was terribly vague about how it's done. like, whether the script can go anywhere or just the headers, do i only use asp extension files or will it work on html files? and the source of the page that offers this way of closing the previous window after a new pops up is different than the script shown. i can't get it to work at all. and i've given up so i'm going back to my old request.

all right, you know the link or button pop-ups used to automatically close a window with? i'm not talking about sending someone to another page, i'm just talking about that "close.window" script


lemme try this

<a
href="javascript:void(0);" onClick='javascript:window.close();">click here</a> to close this window.


Now ... is there anything that can be added to this script that will prevent the alert box from coming up when my visitors click inside a regular browser window? that's all i want to know.

glenngv
03-19-2003, 08:53 AM
did you read the article carefully? the article says there are 2 ways to use the technique. and this is the first, which is to close the current window:

<SCRIPT LANGUAGE="JavaScript">
window.opener = top;
window.close();
</SCRIPT>

it will automatically close the current window without waiting for an event such as onclick.

so to incorporate that technique in your case, you should just call the code above in a link:

<a href="#" onClick='window.opener=top;window.close();">click here</a> to close this window.

that's it! is that what you need?

darkannie
03-19-2003, 09:12 AM
thank you, the code worked exactly like I was aiming for.