<a >  var downloadLink = document.getElementById('downloadFileLink');
        downloadLink.onclick 
= Function("location.href='DownloadHandler.ashx?fileName=" + fileName + "&filePath=" + filePath + "'");
        downloadLink.style.display 
= 'block';
        downloadLink.style.display.visibility 
= 'hidden';
        
//downloadLink.onclick();  //this sentence can't run in firefox
        if (document.all && typeof (document.all) == "object")   //IE  
        {
            downloadLink.fireEvent(
"onclick");
        }
        
else {
            var e 
= document.createEvent('MouseEvent');
            e.initEvent(
'click'falsefalse);
            downloadLink.dispatchEvent(e);
        }
        
return false;

相关文章:

猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-01-11
  • 2022-12-23
相关资源
相似解决方案