0

How do I close the popup window after the file has been opened or saved. Right now document.readyState = complete closes the popup window before the user can either select open or save from the file download option.

    if(document.readyState == "complete")
{
    {
        window.close();
    }
}

Is there a way the window.close can be triggered after the user selects one of the file download options.

Braiam
  • 1
  • 11
  • 47
  • 78
Shilpa
  • 98
  • 3
  • 19
  • you should add more details/code. currently it is hard to answer. All I can suggest is add a js function, call it when the user clicks the download option. – Arun Xavier Feb 19 '16 at 09:18
  • When the user downloads a file, a popup window with regular options like Open Save or Cancel the new file download will be given. So after the user chooses one of the three options,the popup window should close. I do not know how to figure out if the user has chosen one of the 3 options before closing the popup window. – Shilpa Feb 19 '16 at 19:19
  • Please Add relevant code. – Arun Xavier Feb 21 '16 at 17:28
  • Right now I do not have that feature.. I am trying to implement that feature hence have no existing code to add here. – Shilpa Feb 25 '16 at 22:50
  • does [this](http://stackoverflow.com/q/1106377/4290096) or [this](http://stackoverflow.com/q/666468/4290096) question help you ? Is this your case ? – Arun Xavier Feb 26 '16 at 03:55
  • Not all users will even get a Save As.. dialog when they download a file. This is based on the user settings in the browser. Chrome, by default, just downloads the file to the user's download folder - - no dialog is presented. Unless you wish to build your own Save dialog, there is no way to interact with the browser's default downloading settings. – Scott Marcus Mar 06 '16 at 21:41

0 Answers0