$(document).ready(function() {
$('#posHold tbody tr').die();
$('#posHold tbody tr').live('click', function () {
$(".btnPrint").printPage({
url: "receipts/void.jsp?ID=111",
message:"Your document is being created"
});
$('.btnPrint').trigger('click');
});
});
当我点击tr一次时,它会打印到打印机一次。当我再次点击tr时,它打印到打印机2次,然后下次点击3次等等.....即使我也在.live()之前调用.die()
我们如何解决这个问题?
答案 0 :(得分:0)
试试这个:
$(document).ready(function() {
$('a.btnPrint').printPage({
url: "receipts/void.jsp?ID=111",
message:"Your document is being created"
});
});