View Full Version : Java script needed.

04-23-2008, 04:26 PM
Hi i need a javascript which will prompt the users while they close the page with a option of cancel and ok.

like you can see a example on this page...

i am not with this link... just got this as a sample.

04-23-2008, 04:31 PM
That was really annoying but here is the code:

window.onbeforeunload=function(){return "Please do not go, will you?";};

04-23-2008, 05:25 PM
if you just want to ask if they really want to leave the page or not, you could also do that through a link

<a href="/path" onclick="return confirm('Are you sure you want to leave?');">Link</a>

04-23-2008, 05:26 PM
Thank you sir... that was really appericated.