为什么jQuery点击事件不会火?

时间:2013-09-11 01:38:25

标签: jquery jquery-ui jquery-ui-dialog jquery-click-event

点击时不会触发以下jquery代码段。你能帮我找出原因吗?

StackOverflow说我需要更多细节。我道歉。我想不出任何进一步的相关细节。代码对我来说似乎很明显。如果您想到我可以添加的任何细节,请发表评论。

这是HTML:

<div class="footer_all_pro clearfix">
         <ul class="Printing-options clearfix">
         <li>Shipping Labels:</li>
                    <li class="print-usps-label shipper-logo"><a href="#"><img class="print-label-logo" src="/dev/skin/images/logo_endicia.png"></a></li>
                            <li class="print-label shipper-logo"><a href="#"><img class="print-label-logo" src="/dev/skin/images/logo_ups.png"></a></li>
                            <li class="print-fed-label shipper-logo"><a href="#"><img class="print-label-logo" src="/dev/skin/images/logo_fedex.png"></a></li>
                   <li class="print-invoice"><a href="#">Packing Slip</a></li>
         <li class="print-pick"><a href="#">Pick List</a></li>
                    <li class="print-scan"><a href="#">SCAN Report</a></li>
                   <li class="del-scr"><span><img src="/dev/skin/images/print-pick.png"></span><a href="#" style="margin-top: -20px;">Delete</a></li>
          <li class="del-arc"><span><img src="/dev/skin/images/print-pick.png"></span><a href="#" style="margin-top: -20px;">Archive</a></li>
          <li class="send_email"><span><img src="/dev/skin/images/print-pick.png"></span><a href="#" style="margin-top: -20px;">Send Email</a></li>
         <!-- <li class="del-all-inv"><span><img src="/dev/skin/images/print-pick.png" /></span><a href="#" style="margin-top: -20px;">Delete All</a></li>-->
         </ul>
          </div>

这是jquery:

   $( ".print-scan a" ).click(function(e) {
 console.log("scan clicked");
        var $dialog = $("<div />")
                      .dialog({
title: "Confirm SCAN Report",
modal: false, 
resizable: false,
scrollable: true,
width: 65, 
position:['middle',130],

buttons: { "No": function() { $( this ).dialog( "destroy" ); return false;}, 
           "Yes": function() {
console.log("yes clicked"); 
$( this ).dialog( "destroy" ); return false;
        /*
        $(this).datepicker({
            //showOn: "button",
            //buttonImage: "/skin/images/datepicker.png",
            //buttonImageOnly: true,
            onSelect: function(selectedDate) {
console.log("date selected");
               $(".request-print-label")
                 .attr("action",envPath + "/partner/uspsscan")
                 .append('<input type="hidden" name="rpt-date" value="'+selectedDate+'" />')
                 .submit();
               }
            });
        */
        }
      }
    })
    .html("<span>CAUTION: Once shipping labels are included on the SCAN Report, you will be unable to issue refunds for these labels. Proceed anyway?</span>")
    .dialog("open");
    }

谢谢,克里斯。

1 个答案:

答案 0 :(得分:0)

你没有正确关闭点击功能,缺少);最后