Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Wellington, New Zealand
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page asks for permission to close

    Hi All

    Is it possible using script to close an HTML page in IE 5 without getting the confirmation dialog box promting the user if they really wish to close.

    I try and use the <font color=6495ed>window.close()</font color=6495ed> method but it always prompts me if it is allowed to close?

    Your help will be appreciated.

    Thanks

  2. #2
    New Lounger
    Join Date
    May 2001
    Location
    New York City, NY
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Page asks for permission to close

    It depends on how you open the window. If you use a tag like this:

    [url=ex_window_openclose_new.htm]

    the window.close() method will NOT prompt you, because you created an entirely new window.

    Similarly, you can use a tag like this to open a new window:

    [url=java script: window.open('ex_window_openclose_newfromjs.htm'); void('');]

    Again, you will not be prompted when you have a "java script:window.close()" link on the new page.

    There's a good Web reference page (these examples are included) at <A target="_blank" HREF=http://www.michael-thomas.com/javascript/ex_window_openclose.htm>www.michael-thomas.com</A>.

    Hope this helps,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •