Current location: Hot Scripts Forums » General Community » Script Requests » In search of "Confirm on Exit" javascript!


In search of "Confirm on Exit" javascript!

Reply
  #1 (permalink)  
Old 08-03-03, 01:57 PM
ILLIC1T ILLIC1T is offline
New Member
 
Join Date: Aug 2003
Location: California
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation In search of "Confirm on Exit" javascript!

Hey
I'm looking for a javascript that'll ask users if they really wanna leave when they choose to close the page... its a pretty simple script, but i cant seem to find it ANYWHERE!

Thanks for ur help ppl
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-04-03, 05:54 AM
Henry's Avatar
Henry Henry is offline
Wannabe Coder
 
Join Date: Jul 2003
Location: Brisbane, Australia
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
ok i this is a warning sorta message might be what u want:

<html>
<head>

<script type="text/javascript">
function mymessage()
{
alert("This message was triggered from the onunload event")
}
</script>
</head>

<body onunload="mymessage()">

<p>close this window and watch the warning box come up!</p>
</body>

</html>
__________________
henerz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-04-03, 01:32 PM
ILLIC1T ILLIC1T is offline
New Member
 
Join Date: Aug 2003
Location: California
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks, I'll try it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-05-03, 09:08 PM
Asim's Avatar
Asim Asim is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Lahore
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
but I have seen such a script that has two buttons OK and CANCEL
It informs the user that they are about to close this page. if they click cancel the page won't close but when they click ok it will close.

Can u send me that script plz.

Asim
__________________
Asim Zeeshan, asim333 (at) gmail (dot) com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-05-03, 10:57 PM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
Try this:

Edit: That doesnt work, give me a min to update code....
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 08-05-03, 10:59 PM
Henry's Avatar
Henry Henry is offline
Wannabe Coder
 
Join Date: Jul 2003
Location: Brisbane, Australia
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
oh easy just place a confirm box instaed of a prompt box and use the if statement to control the buttons happenings
__________________
henerz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 08-05-03, 11:15 PM
BuildHome BuildHome is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Israel
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
This code will work:

Code:
<html>
<head>

<script language="javascript">
function mymessage()
{
alert("This message was triggered from the onunload event");
}
</script>
</head>

<body onunload="mymessage()">

<p>close this window and watch the warning box come up!</p>
</body>

</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEO Expert Available nakulgoyal Job Offers & Assistance 2 08-14-04 01:38 PM
JS Page Search, repetitive? mtayon Script Requests 2 08-31-03 02:28 AM
The best Henry General HotScripts Site Discussion 1 08-19-03 08:43 PM
Easy, Quick Keyword (Quick Jump) dudeman248 Script Requests 1 08-11-03 02:20 AM
search engine question herman PHP 2 08-05-03 12:41 AM


All times are GMT -5. The time now is 09:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.