Open and close window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ivan Sutton

    Open and close window

    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
  • Lasse Reichstein Nielsen

    #2
    Re: Open and close window

    ivansutton@hotm ail.com (Ivan Sutton) writes:
    [color=blue]
    > I'm quite new to Java:[/color]

    Good for you, but this newsgroup is about Javascript :)
    <URL:http://jibbering.com/faq/#FAQ2_2>
    [color=blue]
    > I installed a script which opened a window in a predefined format.
    > It works fine![/color]
    [color=blue]
    > I want to know if it is possible to close that screen with java.
    > (however, the code should be in the childpage)[/color]

    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 - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...