所以我有一个函数,通过asp.net异步导出一些数据,并在页面上显示一个URL以下载导出的文件,它在chrome中运行得非常好。但在internet explorer中,它显示链接,但链接不能单击,它只是以纯文本呈现!
Export.aspx返回的数据包含导出文件的URL(记住它在chrome中工作得非常好)
function doExport(oper) {
var pass = prompt("Please enter the Admin password", "none");
if (hex_md5(pass) == "592e19c40272fcc615079c346a18d140") {
$("#btnExportStat").attr('disabled', 'disabled');
$("#btnExportView").attr('disabled', 'disabled');
$("#btnAfter").after("<p id='loading'>Please wait...<img src='images/loading.gif' /></p>");
jQuery.post("Export.aspx", { "type": oper }, function (data) {
$('#loading').remove();
if (data.toString() == "error") {
$('#btnAfter').after("<b>There was an error</b>");
} else {
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
var sec = d.getSeconds();
========>>>//$('#btnAfter').after("<a href='" + data + "'>" + "Click here to Download File(" + curr_hour + ":" + curr_min + ":" + sec + ")</p>");
$("#btnExportStat").attr('disabled', '');
$("#btnExportView").attr('disabled', '');
}
});
} else {
alert("Incorrect password");
}
}