TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
43
62.7k
When Customer Close the window Open another Window
Mar 6 2012 8:34 AM
Hi ,
When Customer close or exit the browser i want to open another popup window by using onbeforeunload event the below code that working fine . but my query is when am refreshing the page that time also onbeforeunload event firing.please help me how to solve the problem. Thanks in advance.
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
window.onbeforeunload=function(){
if((window.event.clientX<0) || (window.event.clientY<0))
{
alert("Closing Browser!!!");
window.open("http://www.google.com");
}
else
{
alert("You are not Closing the Browser");
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" />
</div>
</form>
</body>
</html>
Please help me Thanks in Advance ....
Reply
Answers (
3
)
How to load the contents of a URL in a div tag
Ini file in PHP