1document.addEventListener("DOMContentLoaded", function(event) { 2 $('#coupon-subscribe').on('change', function () { 3 let coupon = $(this).val(); 4 if (coupon != '') { 5 let productId = $(this).closest('form').find('input[name=SUBSCRIBE_PRODUCT]:checked').val(); 6 $.ajax({ 7 type : 'POST', 8 url : '/ajax/coupons_apply.php', 9 data : {'COUPON' : coupon, 'PRODUCT_ID' : productId}, 10 dataType : 'json', 11 success : function (ajaxResult) { 12 if (ajaxResult.result && ajaxResult.result == 'apply') { 13 $('.result_coupon_js').html('<div style="color: green">ÐÑпон пÑименен, Ñена подпиÑки Ð´Ð»Ñ Ð²Ð°Ñ ÑоÑÑÐ°Ð²Ð¸Ñ ' + ajaxResult.new_price + ' ÑÑблей</div>') 14 } else { 15 $('.result_coupon_js').html('<div style="color: red">ÐÑибка, кÑпон не найден или не дейÑÑвиÑелен</div>'); 16 } 17 } 18 }); 19 } 20 }); 21 22 $(document).on('change', 'input[name="SUBSCRIBE_PRODUCT"]', function () { 23 $('#coupon-subscribe').trigger('change'); 24 }); 25});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.