I have a file, named download.php
, which contains a file to be downloaded, so it has the following headers (declared with PHP):
header(\"Content-Typ
I have used Onblure but it didn't help at all!
I used below code and it is working for me.
var popupWindow = window.open("endpoint","","setting");
var att = document.createAttribute("onblure"); // Create a "onblure" attribute
att.value = "window.close()"; // Set the value of the class attribute
popupWindow.setAttributeNode(att);
This will allow closing the window when download window appears
Note: endpoint: is your new window endpoint setting: is your window setting for example width, height,top, left .. etc