window.close(); after window.print(); javascript

前端 未结 5 1661
北恋
北恋 2021-01-16 04:43

I need a js code which will close window right after appearing of pop up print window. Here is my code:

P         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 05:02

    This snippet in JQuery prints also dynamic images rendered inside the html.

      
      
    Colombo was great..
    $(function(){ $('body').on('click','button#printreceipt',function(e){ e.preventDefault(); e.stopPropagation(); var printWindow = window.open(''); var divContents = $("#receipt").html() + "
提交回复
热议问题