Mia*_*jum 20 javascript printing firefox jquery
我想在firefox中的加载页面上打印收据页面
Firefox显示以下错误..
使用的getPreventDefault()是过时了.请改用defaultPrevented.错误源代码:
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
Run Code Online (Sandbox Code Playgroud)
NS_ERROR_NOT_AVAILABLE:组件返回失败代码:0x80040111(NS_ERROR_NOT_AVAILABLE)[nsIDOMWindow.print]错误源代码行:
print();
Run Code Online (Sandbox Code Playgroud)
码:
$(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();
}
Run Code Online (Sandbox Code Playgroud)
我想在显示"goBack"和"printRow"id之前打印我的收据,但不能正常工作
将您的Firefox和jQuery版本升级1.6.4到更新版本.
这是作为一个错误在Firefox中的FF11和Patched中提交的结果:
Bug#707677:getPreventDefault(); 弃用
毕竟,错误消息指的是与代码完全无关的源代码行.
您可以使用媒体类型 print创建新的 css
<style media="print">
#goBack,#printRow {
display:none;
}
</style>
Run Code Online (Sandbox Code Playgroud)
使用了这个代码
打印 :
适用于打印文档(也适用于在打印预览模式下查看的文档)。