+
"<style media='print' type=\"text/css\">@page {size: auto; margin: 0mm; }</style>" +
"</head><body >";
var content = "";
var str = document.getElementById('page1').innerHTML;
content = content + str;
str = document.getElementById('page2').innerHTML;
content = content + str;
printStr = printStr+content+"</body></html>";
window.document.body.innerHTML=printStr;
window.print();
第二种方法:
var pwin=window.open(basePath + "ect/?priptoken operator">+pripid+"&sign=1","print");
pwin.document.close();
pwin.print();