The following jquery code snippet will not fire on click. Can you help me figure out why?
StackOverflow says I need more details. I apologize. I can't think of any further relevant details. The code seems pretty self-explanatory to me. If you think of any details I can add, please leave a comment.
Here is the 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>
Here is the 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");
}
Thanks, Chris.
You didn't properly close the click function, missing ); at the end