2013-09-11 188 views
0

下面的jquery代码片段不会触发点击。你能帮我弄清楚为什么?为什么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

你检查了控制台,看看你的'扫描点击'消息是否被写入? –

+1

您没有正确关闭点击功能,缺少');'末尾 – adeneo

+0

@adeneo就是这样。你打算发布一个答案? – HodofHod

回答

0

您没有正确关闭点击功能,遗失);在结尾