Javascript (JQuery) - How to disable Ctrl + P for Chrome -


one of mine application having custom button print customer invoice bill. & browser having default print option (cntrl + p) print window content.

initially, resolved problem adding,

$(document).ready(function(){ $(document).keydown(function(event) { if (event.ctrlkey==true && (event.which == '80') { //cntrl + p event.preventdefault(); } }); }); 

but feel, not feasible solution this. because here binding this(keydown) event on document. on each , every key press on application firing this(keydown) event, & critical per performance concern..

is there other-solution this, disable cntrl + p (without binding event)?

note: important , thing our customer uses google chrome browser access application..

best regards.

as per understanding, if 1 have professional web based pos or business app, printing purpose use jzebra java applete, resolve problems, because doesn't have dependencies on browser print preview or browser's inbuild css etc..


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -