8 replies
Is it possible for a link, when clicked, closes another window that is open in a browser?
  • Profile picture of the author concentrator
    In Firefox you right-click on a link and select Open in a new tab.
    Signature
    My host is Scala Hosting at $3.95. Read a review.
    {{ DiscussionBoard.errors[8445833].message }}
    • Profile picture of the author namso85
      I don't mean it like that.

      I mean a visitor clicks my link and my page opens while their other browser window closes.
      {{ DiscussionBoard.errors[8445855].message }}
      • Profile picture of the author cocoonreal
        Am a real estate agent. whenever clients search using my keyword my site are visible first.
        {{ DiscussionBoard.errors[8445869].message }}
  • Profile picture of the author sanusense
    I don't think so it is possible, and have never seen these kind of stuffs in my lappy
    {{ DiscussionBoard.errors[8446064].message }}
  • Profile picture of the author azhar
    I am not sure about this. I have never heard about this and never seen in my practical experience.
    {{ DiscussionBoard.errors[8446198].message }}
  • Profile picture of the author IdeaBox
    window.open() will return the handle of the window that is open. Assign it to a variable

    var o;
    o = window.open('www.purple.com');

    now, o in a different window is the same as "window" in the new window.

    All you have to do is call
    o.close();

    you may find some browsers ask users "do you want to close this window" or say "a script is trying to close this window" under some circumstances.
    {{ DiscussionBoard.errors[8446667].message }}
  • Profile picture of the author ShareThisContest
    No, it is not possible.
    window.close() will work only for windows opened by the same page.
    {{ DiscussionBoard.errors[8450417].message }}
  • Profile picture of the author LarryKeenan
    One possible workaround is to let the browser think that the parent window was opened programmatic-ally. The following should silently close the parent window after opening the child window:
    Code:
    window.open('link', 'toolbar=no,menubar=...');
    window.open('', '_self', '');
    window.close();
    Have a Great Day!
    Larry Keenan
    {{ DiscussionBoard.errors[8451190].message }}

Trending Topics