SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Close the window in FF

    Hello,
    My pass-through page opens in the new window by commend target="_blank".
    On that pass through page I have "ok" button which allows userto go to the following page and the "cancel" button that should close out that new window.
    I am using <a href="javascript:window.opener='x';window.close();">Close</a>.
    That code does not work in FF. Also in IE I would like the alert window do not show up.
    Any advice.
    Thank you.

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since the user controls if the window is going to open in the new tab or new window there is not much we can do. I guess. Am I right?

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK you can only close a window that you have opened with window.open().
    Birnam wood is come to Dunsinane

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2008
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even if I use window.open to open a new window the user control if the window will open in new tab or new window. If he chooses the tab then there it is impossible to close that window.

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,840
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    It is up to the browser owner where they open new windows and whether they allow the page to close them. The only time a page can even attempt to close a window is when it was opened via a window.open() call and then only when the browser is configured to allow it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •