PageSourceSearch

https://arizer.com/wp-content/plugins/woocommerce-custom-widget/ar…/js/agelimit-front.js?ver=20181205

js arizer.com collected 2026-09-26 03:30:21 UTC 3,791 bytes, 91 lines download raw bytes

1jQuery(document).ready(function($) {
2
3    var currentRequest = null;  
4	
5    jQuery('#billing_country, #billing_state, #date_of_birth').on('change', function() {
6        var billing_country = jQuery('#billing_country option:selected').val();
7		var billing_state = jQuery('#billing_state option:selected').val();		
8	    var birthdate = jQuery('input#date_of_birth').val();
9        var lan = jQuery('.current_language').val();
10
11        currentRequest = $.ajax({
12            //url: wc_checkout_params.ajax_url ,
13            url: agelimit.ajaxurl,
14            type: 'POST',
15            dataType: 'json',
16            data: {
17                action: 'agelimitcheck',
18                country: billing_country,
19                state: billing_state,
20                birthdate: birthdate
21            },
22            beforeSend : function(){           
23                if(currentRequest != null) {
24                    currentRequest.abort();
25                }
26            },
27        })
28        .done(function(response) {
29            jQuery(document.body).trigger('update_checkout');
30            if(response.age != ''){
31                if(lan == "en"){
32                    jQuery('#date_of_birth_field').find('label').text('Please enter Birth Date(Purchase restricted to '+response.age+' and Older)');
33                } else if(lan == "fr"){
34                    jQuery('#date_of_birth_field').find('label').text('Veuillez saisir la date de naissance (achat limité '+response.age+' à et plus)');
35                } else if(lan == "de"){
36                    jQuery('#date_of_birth_field').find('label').text('Bitte geben Sie Ihr Geburtsdatum ein (Kaufbeschränkung für Personen  '+response.age+' ab diesem Alter)');
37                } else if(lan == "it"){
38                    jQuery('#date_of_birth_field').find('label').text('Si prega di inserire la data di nascita (acquisto limitato a '+response.age+' e più anziani)');
39                } else if(lan == "es"){
40                    jQuery('#date_of_birth_field').find('label').text('Por favor, introduzca la Fecha de Nacim
40iento(Compra restringida '+response.age+' a y Mayores)');
41                }
42                else{
43                    jQuery('#date_of_birth_field').find('label').text('Please enter Birth Date(Purchase restricted to '+response.age+' and Older)');
44                }
45            }
46            if( response.status == false ){
47                $('#date_of_birth').attr('data-status', 'false');
48                $('#date_of_birth').attr('data-age', response.age);
49            }
50        })
51        .fail(function() {
52            jQuery(document.body).trigger('update_checkout');
53        })
54        .always(function(response) {
55            if( response.status == false ){
56                $('#date_of_birth').attr('data-status', 'false');
57                $('#date_of_birth').attr('data-age', response.age);
58            } else {
59                $('#date_of_birth').attr('data-status', 'true');
60            }
61        });
62        
63	});
64    
65    /*jQuery('#date_of_birth').mask('99/99/9999',{ placeholder:"dd/mm/yyyy"});*/
66
67
68
69});
70
71var calculateAge = function(birthday, limit) {
72    var now = new Date(limit);
73    var past = new Date(birthday);
74    var nowYear = now.getFullYear();
75    var pastYear = past.getFullYear();
76    var age = nowYear - pastYear;
77
78    return age;
79};
80
81
82var readCookie = function(name) {
83        var nameEQ = name + "=";
84        var ca = document.cookie.split('; ');
85        for (var i = 0; i < ca.length; i++) {
86            var c = ca[i];
87            while (c.charAt(0) == ' ') c = c.substring(1, c.length);
88            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
89        }
90        return null;
91    }

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.