我想在加载链接时在 extjs 中获取 watingmessage。响应是一个二进制代码,我想下载它。该链接例如是“test.php”。
function loadurl(link){
Ext.MessageBox.wait('Loading ...');
Ext.Ajax.request({
url: link,
callback: function(options, success, response){
Ext.MessageBox.updateProgress(1);
Ext.MessageBox.hide();
if (success) {
// response : my attachment
}
else {
}
},
scope: this
});
}
{
...
//functioncall
loadurl('test.php');
}
我也在 test.php 中尝试过。
<?php
header('Content-Disposition: attachment; filename="'.$filename.'"');
echo $content;
?>
但它不起作用。如果我只是加载链接它可以工作,但没有等待消息。