0
$(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()

我们如何解决这个问题?

4

1 回答 1

0

尝试这个:

$(document).ready(function() {
   $('a.btnPrint').printPage({
        url: "receipts/void.jsp?ID=111",
        message:"Your document is being created"
    });
 });
于 2012-06-12T08:35:02.150 回答