qq_37839345
qq_37839345
采纳率0%
2018-09-25 15:18 阅读 1.9k

JSP中调用JQuery.fileDownload.js,为什么在IE兼容模式下无法起作用,该如何解决?

5
  function openFile(fileId,fileName){
          var url="../../dfish-frame/sysDownContent/homeDownLoadFile";
          $.fileDownload(url,{
               data:"fileId="+fileId+"&fileName="+fileName,
                /* prepareCallback: function(url){
                              alert("正在导出,请稍后...");
                  },  */
               successCallback: function(url){
               alert("下载完成!");
               },
               failCallback: function (html, url) {
               alert("下载失败,未知的异常。");
               } 
          }); 
$(function() {
                $.ajax({
                        type: "post",
                        dataType:'json', //接受数据格式
                        cache:false,
                        //data:"typeId="+null,
                        url: "../../dfish-frame/sysDownContent/HomeDisplay",
                        beforeSend: function(XMLHttpRequest){
                        },
                        success: function(data){
                              var jsons=data;   
                              var arr = eval(jsons); 
                              var DownContent = $("#DownContent");
                              DownContent.html("");
                              var li = "";
                              for(var i = 0; i < arr.length; i++){
                                  var fileId=arr[i].fileId;
                                  var fileName=arr[i].fileName;
                                  li += "<li  onclick=\"openFile('" + fileId + "','" + fileName + "')\">" 
                                  li +="<a style='font-size:13pt;cursor:pointer;'>"
                                  li +=arr[i].fileName
                                  li +="</a>"
                                  li +="</li>"
                              }

                              DownContent.append(li);
                        },
                        error: function(){
                            alert("Error!");
                        }
                 }); 

       })

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

相关推荐