I’m trying to use this trick to open a file download dialog on document ready. The same trick has worked another time for me, but that time the iframe was added after an ajax call. This is the snippet:
<script type="text/javascript">
$(document).ready(function() {
var url='/my_file_url/';
var _iframe_dl = $('<iframe />')
.attr('src', url)
.hide()
.appendTo('body');
});
</script>
While the iframe is correctly printed in html code, it doesn’t have the expected behaviour: no download file popup appears after loading the page. Any help on why?