[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.
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?