//lqm 2016-6-23 function HtmlToPDF() { var domain = "http://"+ window.location.host;//'http://www.itag4.com/'; var content = $("#rpt_content").html(); var filename = $("#report_fileName").text(); var html = "" + "" + "" + ""+ "" + "
"+ "
"+ "
" + "
"+ "" + content + "" + "
" + "
" + "
" + "
" + "
" + ""; var form = $("
"); //定义一个form表单 form.attr('style', 'display:none'); //在form表单中添加查询参数 form.attr('target', ''); form.attr('method', 'post'); form.attr('action', "/Shared/HtmlToPdf") form.attr("id", "myforms"); var ihtml = $(''); ihtml.attr('type', 'hidden'); ihtml.attr('name', 'html'); ihtml.attr('value', encodeURIComponent(html)); var ifilename = $(''); ifilename.attr('type', 'hidden'); ifilename.attr('name', 'filename'); ifilename.attr('value', filename); $('body').append(form); form.append(ihtml); form.append(ifilename); form.submit(); }