Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm
Đã lưu trữ

Don't work style in js. Only 67.0 version (old - OK)

lvlukola đã trả lời
lvlukola

function CallPrint(strid,cstatus) { var formData = new FormData(); formData.append("id", strid); formData.append("getprint", true);

var xhr = new XMLHttpRequest(); xhr.open("POST", "getprintord.php"); // async=true xhr.onload = function (e) { if (xhr.readyState == 4 && xhr.status == 200) { var html = JSON.parse(xhr.responseText)

var prtCSS = '<link rel="stylesheet" href="css/print.css" type="text/css">'; var WinPrint = window.open(,,'left=50,top=50,width=800,height=640,toolbar=0,scrollbars=1,status=0'); WinPrint.document.write(''); WinPrint.document.write('

'); WinPrint.document.write(prtCSS); WinPrint.document.write(html); WinPrint.document.write('
'); WinPrint.document.write(''); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); //WinPrint.close(); } }; xhr.send(formData);

if (cstatus == 3 || cstatus == 4) { document.getElementById("sel_status" + strid).value = "6"; document.getElementById("sel_status" + strid).onchange() } }

function CallPrint(strid,cstatus) { var formData = new FormData(); formData.append("id", strid); formData.append("getprint", true); var xhr = new XMLHttpRequest(); xhr.open("POST", "getprintord.php"); // async=true xhr.onload = function (e) { if (xhr.readyState == 4 && xhr.status == 200) { var html = JSON.parse(xhr.responseText) var prtCSS = '<link rel="stylesheet" href="css/print.css" type="text/css">'; var WinPrint = window.open('','','left=50,top=50,width=800,height=640,toolbar=0,scrollbars=1,status=0'); WinPrint.document.write('<!DOCTYPE html><html lang="ru">'); WinPrint.document.write('<div id="print" class="contentpane">'); WinPrint.document.write(prtCSS); WinPrint.document.write(html); WinPrint.document.write('</div>'); WinPrint.document.write('</html>'); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); //WinPrint.close(); } }; xhr.send(formData); if (cstatus == 3 || cstatus == 4) { document.getElementById("sel_status" + strid).value = "6"; document.getElementById("sel_status" + strid).onchange() } }
Đính kèm ảnh chụp màn hình

Tất cả các câu trả lời (1)

I solved it this method:

function CallPrint(strid,cstatus) { var formData = new FormData(); formData.append("id", strid); formData.append("getprint", true);

var xhr = new XMLHttpRequest(); xhr.open("POST", "getprintord.php"); // async=true xhr.onload = function (e) { if (xhr.readyState == 4 && xhr.status == 200) { var html = JSON.parse(xhr.responseText) //var prtCSS = '<link rel="stylesheet" href="css/print.css" type="text/css">'; var WinPrint = window.open(,,'left=50,top=50,width=800,height=640,toolbar=0,scrollbars=1,status=0'); WinPrint.document.write(''); WinPrint.document.write(''); WinPrint.document.write('

'); //WinPrint.document.write(prtCSS); WinPrint.document.write(html); WinPrint.document.write('
'); WinPrint.document.write(''); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); } }; xhr.send(formData);