|
-
Jun 1st, 2011, 01:04 PM
#1
Thread Starter
Lively Member
[RESOLVED] How to stop closing a web browser when user clicks a close button
HI
Can any one advise me how to stay in the web page when a user clicks on the "X"(upper right corner of a web page) button of a web page?
i wrote a java script function in beforeOnUnload event of a page , when user clicks on the "X" button i am geting a my own alert message saying taht r u want to close the web page click yes else click no.
function handlewebpageCloseEvent(){
// code to show alert message yes / no
var sconfirm = ///gets a values yes / no
if (sconfirm== 'yes')
{
window.close();
}else{
window.event.returnvalue=false;
// this is agian opening a new alert message whether users wants to navigate to a new page or stay in the same page
}
when a user clicks yes my web page is closing ,but when a user clicks "no". its opening a alert message whether users wants to navigate to a new page or stay in the same page
i dont want the second alert message , can any one advise me how to stay in the same web page.
Last edited by vkkishore_s; Jul 20th, 2011 at 07:09 AM.
Reason: edit the subject
-
May 21st, 2012, 04:51 AM
#2
New Member
Re: [RESOLVED] How to stop closing a web browser when user clicks a close button
I am also facing same problem.Can you please how we can sort out this problem?
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
|