help needed with this JS !!!

M

Mel

i have the following:

window.onbeforeunload = confirm;

function confirm()
{
if (event.clientY < 0) {
event.returnValue = 'Leave this page ?';
}
}

what i need is if the user clicks "OK" i want the top window to go to a URL
and then "CLOSE" the toplevel window altogether. otherwise nothing should
happen !

can you please help this pooor neeeewbeeeeee
 
M

McKirahan

Mel said:
i have the following:

window.onbeforeunload = confirm;

function confirm()
{
if (event.clientY < 0) {
event.returnValue = 'Leave this page ?';
}
}

what i need is if the user clicks "OK" i want the top window to go to a URL
and then "CLOSE" the toplevel window altogether. otherwise nothing should
happen !

can you please help this pooor neeeewbeeeeee

Trap window close event for IE browser
http://dotnetjunkies.com/WebLog/familjones/archive/2004/04/06/10884.aspx

"... sorry to say this, but there is no way you can stop the window from
closing. "


Also, though there seems to be no problem, I wouldn't label a function
"confirm" as it's already a method name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top