Click to See Complete Forum and Search --> : document.write() is NOT what I need...


dmason165
03-09-2003, 10:14 PM
Hello All!

I'm using the following code to confirm a user's decision:

function AreYouSure() {
var agree=confirm("Are you sure you want to exit?\nClick OK to exit.\nClick CANCEL to remain on this page.")
if (agree)
window.close();
else
document.write();
}

The document.write() command is not returning the user to the page from which he tried to exit. What should the command be?

As always, thank you for your time and your help. I am most appreciative!

~Darron

dmason165
03-09-2003, 10:28 PM
Dave,

Thank you for that script. It works nicely, but if it is possible, what can I put that will keep the page where it is on the screen as opposed to returning to the top?

Thanks.

~Darron

dmason165
03-09-2003, 10:39 PM
Here's what I use to call the function:

<a href="javascript:AreYouSure()">Close This Site</a>

Sorry about that...hope that helps.

~Darron

dmason165
03-09-2003, 10:48 PM
Thanks Dave!

~Darron

russ801
03-10-2003, 11:54 AM
what si the purpose of the void?

boojum
03-10-2003, 01:55 PM
void forces the expression to return undefined

so it doesnt double link i guess