The use of getPreventDefault () is deprecated. Use defaultPrevented instead

advertisements

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


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