Quantcast
Viewing all articles
Browse latest Browse all 37

closing a window popup based on result

I am trying to open a window from a click then after the response in the url that consist of a confirmation page if is success it will close the window.

I opened my window with this:

        url = 'http:/mywebsite/index';        width = 545;        height = 433;        var leftPosition, topPosition;        //Allow for borders.        leftPosition = (window.screen.width / 2) - ((width / 2) + 10);        //Allow for title and status bars.        topPosition = (window.screen.height / 2) - ((height / 2) + 50);        //Open the window.        window.open(url, "Window2", "status=no,height="+ height +",width="+ width +",resizable=yes,left="+ leftPosition +",top="+ topPosition +",screenX="+ leftPosition +",screenY="+ topPosition +",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");

The returned of the URL http:/mywebsite/index is a json dump with a dictionary of success whether true or false. I code this with python btw.

The problem I am encountering is how to close the window from the return of the python.

I tried returning a string as HTML and javascript consisting of window.close(). But no luck. Please do tell me if I am doing something wrong or what should be the method.

Thanks.


Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>