java web项目 文件下载中,后台不报错,而浏览器没有任何的反应的处理方案

   <div class="father">
          <span class="label label-default" id="dianji">点击跳转</span>
          <span class="label label-primary" id="daochu">导出文件</span>
          <span class="label label-success" id="down">下载文件</span>
    </div>

   点击事件如下 :

   $("#down").on("click",function (){      
                 // 如果要用ajax 发送的话,则浏览器没有任何反应  因为ajax返回的格式是  字符的格式 
                 /*  $.ajax({
                           url:"${ctx}/down",
                           type:"POST",
                           dataType:"json",
                           success:function(result){

                      }
              }); */
              // 用下面的方式  则浏览器有反应
              window.location.href="${ctx}/down";
             });

猜你喜欢

转载自blog.csdn.net/qq_37469931/article/details/86630955
今日推荐