How do I close a download window with jQuery
on Internet Explorer
?
Example:
<?php
$arquivo = $_GET["arquivo"];
header("Location: $arquivo");
echo "<script>
$(window).ready(function() {
window.close();
});
</script>";
?>
The link:
<script>
function winOpen() {
window.open("download2.php?torrent=$row[torrent]&id=$row[id]&user=$_SESSION[logininput]"
,null, "height=70,width=470,status=yes,toolbar=no,menubar=no,location=no,resizable=no");
}
</script>
<a href="javascript:;" onclick="winOpen()">TORRENT</a>
The above code works in Firefox
, but not IE
, remembering that this window is a file download popup that is a torrent that will open.