I use the following ajax to open a url that make and download xls and pdf reports. This open a iframe
in jquery dialog.
When the dialog open the user will must wait to download the file. When the file downloaded I want to close the dialog.
I tried the following but is not work any idea?
$.ajax({
type: 'POST',
url: '../menu/solonreport.jsp',
data: {
Wreportid: reportid,
Wreporttype: reporttype
},
async: false,
dataType: 'json',
success: function(json) {
var ifr = $('<iframe/>', {
id: 'iframereport',
src: json.url,
style: 'display:none',
load: function() {
$("#dialog-report").dialog("close");
}
}
});
$("#dialog-report").append(ifr).dialog();
});
following the html:
<div id="dialog-report" title="Eκτύπωση" style="display: none;">
<span class="ui-icon ui-icon-info" style="float:left; margin:0 7px 50px 0;"></span>
Please wait...
<iframe id="iframereport" src="" width="0" height="0"></iframe>
</div>