0
<html>
<head>
    <title>Disable Browser Back Button Using JavaScript</title>

  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type='text/javascript'>
    $(function() {

        try{
            opera.setOverrideHistoryNavigationMode('compatible');
            history.navigationMode = 'compatible';
        }catch(e){}

        function ReturnMessage()
        {
            return "wait";
        }

        function UnBindWindow()
        {
            $(window).unbind('beforeunload', ReturnMessage);
        }

        $(window).bind('beforeunload',ReturnMessage );
    });
</script>
</head>
<body>
<a href="index.php">Click Here...</a>
<?php

echo "this is an test page for browser back button disabled";

?>
</html>

I have enter the above code for showing alert when closing the tab and window. It shows stay and Leave button default. I want to show the stay button only. Could you please give an idea for solving the problem.? is it possible to remove a Leave button.

0 Answers0