SPUG: Closing a window from perl

Richard Wood wildwood_players at yahoo.com
Wed Jul 12 13:01:21 CDT 2000


John & Stephan, et.al.

Thanks for your assistance.  I have things working
now.

I wasn't able to get the print self.close() to work 
but printing the <SCRIPT> snippit did the trick.

I will try to summarise in case anyone else can use
this information.

In my main application which displays database schema
information I have the following code:

print "\n".
      TR("\n\t".
      td({ -STYLE=>"border-top: 1px solid black",
	  -onClick=>"open('/cgi-bin/defn.cgi?term=$cur_col',
	 	'Defn',
		'resizable,width=220,height=180'
		)"},
	  	a({-name=>"COL_$cur_col",
	  	-target=>"newframe"},$cur_col)));

In my defintion application I have the following code:

if (I want to close this window) {
    my $output = qq(
		    <script type="text/javascript"
 			language="JavaScript">
		    	window.close();
		    </script>
		    );

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

Thanks for your help.  

Regards,

Rich Wood
--- Richard Wood <wildwood_players at yahoo.com> 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/
> 
> 


=====
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/





More information about the spug-list mailing list