PageSourceSearch

https://nkj.ru/bitrix/templates/.default/components/reprezo/subscribe.make/promocode/script.js?16376670721228

js nkj.ru collected 2026-09-24 08:26:32 UTC 1,228 bytes, 25 lines download raw bytes

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.