-
Mar 4th, 2009, 04:48 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Jasascript - Are you sure you want to leave this page
I see it all over the place...you are on a web site...you accidentally click the X instead of the minimize/maximize button...and the Javascript prompts you "Are you sure you want to leave this page?"
How is this done?
Which X do you like better???
Code:
x x \ /
x x \ /
x x \ /
x ><
x x / \
x x / \
x x / \
-
Mar 9th, 2009, 03:49 PM
#2
Thread Starter
Hyperactive Member
Re: Jasascript - Are you sure you want to leave this page
Which X do you like better???
Code:
x x \ /
x x \ /
x x \ /
x ><
x x / \
x x / \
x x / \
-
Mar 10th, 2009, 07:15 AM
#3
Re: Jasascript - Are you sure you want to leave this page
A little javascript should do it.
Code:
<html>
<head>
<script language="javascript" type="text/javascript">
window.onbeforeunload = askConfirm;
function askConfirm(){
return "You have unsaved changes.";
}
</script>
</head>
<body>
</body>
</html>
-
Mar 10th, 2009, 11:27 PM
#4
Re: Jasascript - Are you sure you want to leave this page
@ rrrctraptor31
Instead of putting the code in each page put it in an external javascipt file.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Mar 11th, 2009, 07:10 AM
#5
Thread Starter
Hyperactive Member
Re: Jasascript - Are you sure you want to leave this page
thank you both...i plan on using this in a time clock system that I have build...it used DHTML windows...so there is only one real page...everything else is in <#includes>
Which X do you like better???
Code:
x x \ /
x x \ /
x x \ /
x ><
x x / \
x x / \
x x / \
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|