我在JavaScript中有下列下载请求:如何捕获附件响应窗口的onload事件?
var exportWindow = window.open('Download.ashx?source=1', '');
exportWindow.onload = function() {
alert('finished');
};
我的问题是,上面的提示框不会出现。 download.ashx设置了以下响应(它将被保存为一个csv文件),它可以正常工作。
context.Response.ClearContent();
context.Response.ContentType = "application/text";
context.Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
context.Response.Write(resultWriter.ToString());
context.Response.Flush();
context.Response.Close();
如果我更换一个正常的aspx页面的download.ashx,然后出现警报。 所以我的问题是:是否有可能以编程方式知道dowload.ashx返回响应? (使用FF3)提前
感谢, 格扎
我很害怕这个答案:-(。谢谢! – egyedg 2010-01-27 10:32:18