Print function in Chrome no longer working

前端 未结 6 1441
感情败类
感情败类 2020-12-03 19:36

Our website has a feature whereby a member profile can be printed. The way that it works is that a javascript function is attached to a button via an onsubmit. The javascrip

6条回答
  •  借酒劲吻你
    2020-12-03 20:11

    I also get the same problem with this methods

       window.print();
       window.close();
    

    even recognizing the browser and then executing the code accordingly is good. But this is a very handy and short cut solution to fix this issue only by two line.

       document.execCommand('print');
       window.close();
    

    working perfectly fine in chrome and IE

提交回复
热议问题