hot to close jsp page(browser page) with out warning window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LVenkatrao
    New Member
    • Nov 2008
    • 2

    hot to close jsp page(browser page) with out warning window

    i tried to close the jsp page using window.close()/self.close() it is giving warning window how to close the browser page with out warning window
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    This is correct, and there is a hack that could make the browser think that it's been opened by JavaScript and thus close without warning, but I don't think it works in newer browsers.

    Comment

    • joyenjoy123
      New Member
      • Nov 2008
      • 2

      #3
      [HTML]<HTML>
      <script type="text/javascript">
      function closeme()
      {
      window.opener=s elf;
      window.close();
      }
      </script>
      <body>
      <input type= "button" value= "close" onclick="javasc ript:closeme(); ">
      </body>
      </HTML>
      [/HTML]

      TRY THIS
      Last edited by acoder; Nov 19 '08, 10:34 AM. Reason: Added [code] tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        That's one version of the hack I mentioned. Besides the obvious missing head, it doesn't work. Which browsers did you test on?

        By the way, I think this warning is a good thing.

        Comment

        • joyenjoy123
          New Member
          • Nov 2008
          • 2

          #5
          tested on ie

          and it worked

          was sitting idle

          just wanted to help

          forum is too good



          ....

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by joyenjoy123
            tested on ie
            Which version of IE?
            Originally posted by joyenjoy123
            just wanted to help
            Of course, you're more than welcome to do so.

            Comment

            Working...