SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast earph's Avatar
    Join Date
    May 2004
    Location
    Austin
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window.close(); Stop triggering pop-up.

    I'm using a simple window.close script on a link, but when I click on the link my browser pops a message asking "are you sure you want to close this?".

    Is there anyway I can make it not do that?

    <a href="javascript:window.close();">Close Window</a>

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I bet you're using IE6 on WinXP SP2. Am I right?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE has ALWAYS done that IF your trying to close the main browser window.... it works fine on pop ups but IE has ALWAYS done it that way...

    Ive never tried it on any other browser but I know that error all to well!

  4. #4
    SitePoint Enthusiast earph's Avatar
    Join Date
    May 2004
    Location
    Austin
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah Kravvitz , you're right. Alright guys, thanks....... I was just wondering if there was some way to get rid of it. Guess not.....

  5. #5
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a security precaution.

    It's to keep malicious scripts from closing windows that they didn't open.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Bookmarks

Posting Permissions

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