【问题标题】:Dynamic form Post not working in mozilla动态表单帖子在Mozilla中不起作用
【发布时间】:2015-12-08 06:20:14
【问题描述】:

这是我动态生成的表格。下载 pdf。 它在google chrome 中运行良好。但在firefox 中没有使用该服务。


 $scope.downloadSettledReport = function () {
                var template = "  <html> <head> <style> div{font-size: 10px;}table, .center{margin: auto; width: 60%; padding: 10px;}</style> </head> <body class='center'> <table> <tr> <td>" + $scope.downloadContent[0].outerHTML + "</td></tr></table> </body></html>";
                var element = $('<form/>');
                element.html('<input type="text" name="fileHtml" value="' + encodeURI(template) + '"/>   <input type="text" name="fileName" value="SettlementREport.pdf"/>');
                element.attr({ method: 'POST', action: UtilitiesService.getUrlPrefix() + "/hosp/file/getPdf" }).submit();              
            }

【问题讨论】:

    标签: javascript firefox forms http-post


    【解决方案1】:

    我刚刚将 html 模板附加到 body 并开始工作。

     $scope.downloadSettledReport = function () {
                var template = "  <html> <head> <style> div{font-size: 10px;}table, .center{margin: auto; width: 60%; padding: 10px;}</style> </head> <body class='center'> <table> <tr> <td>" + $scope.downloadContent[0].outerHTML + "</td></tr></table> </body></html>";
                var element = $('<form/>');
                element.html('<input type="text" name="fileHtml" value="' + encodeURI(template) + '"/>   <input type="text" name="fileName" value="SettlementREport.pdf"/>');
                element.attr({ method: 'POST', action: "action: UtilitiesService.getUrlPrefix() + "/hosp/file/getPdf"" });
                $(document.body).append(element);
                element.submit();
    
            }
    

    【讨论】:

      猜你喜欢
      • 2014-09-09
      • 1970-01-01
      • 2011-12-30
      • 2015-02-19
      • 2018-10-16
      • 2018-09-17
      • 2016-10-22
      • 2015-12-08
      • 2010-12-20
      相关资源
      最近更新 更多