How to Disable the CTRL+P using javascript or Jquery?

后端 未结 11 1085
一生所求
一生所求 2020-12-31 06:17

Here I tried to disable the Ctrl+P but it doesn\'t get me alert and also it shows the print options

jQuery(document).bind(\"keyup keydo         


        
11条回答
  •  长发绾君心
    2020-12-31 06:36

    If you want to disable printing of your webpage you're wasting your time: it can't be done. Even if you work out how to capture CTRL-P users can still use the browsers menu bar to find the print command, or they can take a screen shot of the browser.

    Stop trying to control the user, put your energy into making your site / app more useful, not less useful.

    edit 2016: in the 3 years this has been up it has gathered 3 downvotes. I'm still not deleting it. I think it is important to tell fellow developers when they are given impossible tasks, or tasks that make no sense.

    edit 2018: still think it's important that people that have this question read this answer.

提交回复
热议问题