我有一個MVC Web應用程序,我們要打印收據,但由於我們有POS系統和熱敏打印機,我們不想打印對話框和收據應直接打印。在MVC中直接打印沒有熱打印機的打印對話框.net
我們有以下代碼,但正在彈出。任何人都可以提供幫助嗎?我們正在尋找完整的跨瀏覽器支持。
的代碼如下附:預先
<script type="text/javascript">
// var q = jQuery.noConflict();
$("#btnPrint").live("click", function() {
var divContents = $("#dvContainer").html();
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(divContents);
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
q('.print default').trigger('click');
});
</script>
感謝。
你不能。這是瀏覽器的控制器。 –