Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

close web browser windows

by mbond (Beadle)
on Jan 02, 2001 at 21:17 UTC ( [id://49325]=perlquestion: print w/replies, xml ) Need Help??

mbond has asked for the wisdom of the Perl Monks concerning the following question:

I have a web page that opens a new browser window, writes to
a log file, then redirects the browser to a new location.
I do this using:

print "location: $URL\n\n";

In one instance this opens up a third window, by the site that
is being called. I would like ot close the window I opened, so that there continue to only be 2 windows open. Is there and easy way to do this? I no longer have control over the window i opened onc ther third opens ... or at least i don't think that i do ... i tried using <script>window.close</script> but that didn't work :-(

thanks
Mbond

Replies are listed 'Best First'.
(JavaScript) Re: close web browser windows
by mwp (Hermit) on Jan 02, 2001 at 21:22 UTC
    This isn't a JavaScript site, so technically we're not supposed to answer JavaScript questions, but I take pity on you. And it's a quick answer.
    <html> <head> <title>The Newly Opened Page</title> </head> <body onLoad="window.opener.close()" ...>
    There's a great (my favorite) JavaScript references at http://developer.netscape.com. Look around under "Documentation." HTH!
Re: close web browser windows
by arturo (Vicar) on Jan 02, 2001 at 21:23 UTC

    You can't generally use server-side Perl to dictate the behavior of clients such as browsers. To close browser windows and the like, you need to look into using Javascript. Try, e.g. http://www.javascript.com

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: close web browser windows
by mbond (Beadle) on Jan 02, 2001 at 22:35 UTC
    Okay thanks guys .. I was HOPING beyond HOPE that i could do it using perl somehow ... but oh well ... thank you anyways

    I hate java/javascript :)

    mbond.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://49325]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found