我在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