Downloading Zip File Using JS Window.open _self Without "useless Window"
Following information from this page where the issue of the 'useless empty window' is discussed, I'm trying to create a script that starts the download of a zip file:
Solution 1:
You can use a hidden iframe instead. The window.open will clear all your page content when using _self.
Here is a quick example
<a href="archive.zip" target="download_frame">Initiate download from link</a>
<iframe id="download_frame" name="download_frame" src="about:Blank" style="width:0px; height:0px; overflow:hidden;" frameborder="0" scrolling="no"></iframe>
<script type="text/javascript">
// initiate download by script
// add this in onload event or after the iframe
document.getElementById('download_frame').src="archive.zip";
</script>
Post a Comment for "Downloading Zip File Using JS Window.open _self Without "useless Window""