Open and close window

Discussion in 'Javascript' started by Ivan Sutton, Sep 17, 2003.

  1. Ivan Sutton

    Ivan Sutton Guest

    Hi,

    I'm quite new to Java:
    I installed a script which opened a window in a predefined format.
    It works fine!

    I want to know if it is possible to close that screen with java.
    (however, the code should be in the childpage)

    Thank you,

    Ivan
    Ivan Sutton, Sep 17, 2003
    #1
    1. Advertising

  2. (Ivan Sutton) writes:

    > I'm quite new to Java:


    Good for you, but this newsgroup is about Javascript :)
    <URL:http://jibbering.com/faq/#FAQ2_2>

    > I installed a script which opened a window in a predefined format.
    > It works fine!


    > I want to know if it is possible to close that screen with java.
    > (however, the code should be in the childpage)


    Javascript!

    the Javascript code to close the current window (if it has been opened
    via Javascript) is "window.close()". You can't close the original window,
    at least not without the user's permission. This is to prevent a malicious
    web page from closing the browser and destroying the browsing history ...
    not a bad threat, but still highly annoying.

    If you want a button that closes the window it is in, you can write,
    e.g.:
    <input type="button" value="Close Window" onclick="window.close()">

    /L
    --
    Lasse Reichstein Nielsen -
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
    'Faith without judgement merely degrades the spirit divine.'
    Lasse Reichstein Nielsen, Sep 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?a2x5bm4=?=

    open window & close prior window

    =?Utf-8?B?a2x5bm4=?=, Oct 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    493
    =?Utf-8?B?a2x5bm4=?=
    Oct 7, 2005
  2. Dave
    Replies:
    11
    Views:
    5,093
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    817
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    351
    Gérard Talbot
    Sep 2, 2005
  5. Iulian Ilea
    Replies:
    1
    Views:
    290
    pcx99
    Dec 21, 2006
Loading...

Share This Page