SPUG: Closing a window from perl

Stephen Nickels snickels at u.washington.edu
Tue Jul 11 19:04:38 CDT 2000


All you should have to do is print out a javascript
window.close() statement. Something like:

# warning, untested pseudo code ahead...

if (we_want_to_close_the_window) {

  my $output = qq(
<script type="text/javascript" language="JavaScript">
window.close();
</script>
                 );

  print "Content-type: text/html\n\n";
  print $output;
}

# end of pseudo code...



Does this help?
--Steve Nickels


On Tue, 11 Jul 2000, Richard Wood wrote:

> Hi everyone,
> 
> I have a web page of database column names.  When you
> click on one of the names, javascript's open()
> function is called to open a new window and a perl
> script is invoked to fill it.  
> 
> -onClick=>"open('/cgi-bin/defn.cgi/$cur_col','Defn','resizable,alwaysRaised,width=220,height=180')"}
> 
> The perl script defines a frameset and then re-invokes
> itself to fill the frame.
> 
> frameset({-cols=>'100%'}, 
> frame({-name=>'framit',-src=>"/cgi-bin/defn.cgi/framit?term=$frame_name"}));
> 
> On the second pass through, the definition for the
> column is retrieved from a file, put into a textarea
> form field, a submit button is put on the page and the
> whole thing is displayed quite nicely.  In this way,
> the user can update the definition if they know a
> better one.
> 
> Now my question.  How do I get rid of the dialog if
> the user updates the text and presses the submit
> button?  I get the text back into the perl program but
> I can't figure out (or find documentation on) how to
> tell the dialog to go away.  I figure I must have to
> send some sort of HTTP response header to say,
> "Thank-you very much but we won't be needing you
> anymore", but how do you do that?
> 
> Regards,
> 
> Rich Wood
> 
> =====
> Richard O. Wood
> Wildwood IT Consultants, Inc.
> wildwood_players at yahoo.com
> 206.605.2539
> http://resumes.dice.com/richardowood
> 
> __________________________________________________
> Do You Yahoo!?
> Get Yahoo! Mail – Free email you can access from anywhere!
> http://mail.yahoo.com/
> 
>  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
>       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
>   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
>  For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
>   Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
> 
> 
> 

"When once you have tasted flight, you will forever walk
the Earth with your eyes turned skyward, for there you have been,
and there you will always long to return"
					-Leonardo da Vinci


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For full traffic, use spug-list for LIST ; otherwise use spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list