• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

closing a window

I have a pop up window with two buttons. The ok will submit to a process page which will do  some server side processing. Once this has been completed, How can I close the popup window?
0
inzaghi
Asked:
inzaghi
1 Solution
 
Mayank SAssociate Director - Product EngineeringCommented:
Sounds like a web-application and sounds like the same pop-up window needs to be notified by the server once it has finished the processing. Since this might be asynchronous, did you try AJAX?
0
 
inzaghiAuthor Commented:
Have not tried Ajax, coudn't I just use  javascript at the end of the page

<javascript>

window.close()

</javascript>
0
 
radarshCommented:
Non-AJAX way
============

When you hit submit, the control will go to the server and your browser will wait for
a response. Until that is returned, you'll see a blank page. You can execute closing
by returning a "text/javascript" content-type response from the server, containing
the following code:

"<script type=\"text/javascript\">self.close();</script>"

AJAX way
========
AJAX being asynchronous, you can continue to display the page even after the submit
has been clicked. In the background, the server processes and once it returns the
response, a callback handler takes the response and executes it.


________
radarsh
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now