I want to Print receipt page on loading page in firefox
Firefox shows following error..
Use of getPreventDefault()
is deprecated. Use defaultPrevented instead.
error source line:
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDOMWindow.print] error source line:
print();
code:
$(document).ready(function() {
print_doc();
$("#Submit").click(function() {
$("#goBack").hide();
$("#printRow").hide();
print();
$("#goBack").show();
$("#printRow").show();
});
});
function print_doc() {
$("#goBack").hide();
$("#printRow").hide();
print();
$("#goBack").show();
$("#printRow").show();
}
I want to print my receipt before showing "goBack", and "printRow" id's but not working
Upgrade both your versions of Firefox & jQuery version from 1.6.4
to a more recent version.
This was filed as a bug in Firefox in FF11 & Patched as a result:
Bug #707677: getPreventDefault(); deprecated
As after all, the error messages refer to lines of source code that are completely unrelated to your code.
you can create new css with media type print
<style media="print">
#goBack,#printRow {
display:none;
}
</style>
used this code
print :
Intended for printed documents (applies to docs viewed in print preview mode too).
CSS Media Type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With