PageSourceSearch

https://smartwaste.ai/assets/js/functions.js?v=n912W1JMHX

js smartwaste.ai collected 2026-10-05 15:06:41 UTC 4,011 bytes, 138 lines download raw bytes

1function modalNotify(text){
2    $("#popup-notify").find(".modal-body").html(text);
3    $('#popup-notify').modal('show');
4}
5
6function ValidationFormSelf(ele=''){
7    if(ele){
8        $("."+ele).find("input[type=submit]").removeAttr("disabled");
9        var forms = document.getElementsByClassName(ele);
10        var validation = Array.prototype.filter.call(forms,function(form){
11            form.addEventListener('submit', function(event){
12                if(form.checkValidity() === false)
13                {
14                    event.preventDefault();
15                    event.stopPropagation();
16                }
17                form.classList.add('was-validated');
18            }, false);
19        });
20    }
21}
22
23function loadPagingAjax(url='',eShow='',id='',id_post=0){
24    if($(eShow).length && url){
25        $.ajax({
26            url: url,
27            type: "GET",
28            data: {
29                eShow: eShow,
30                id:id,
31                id_post:id_post
32            },
33            success: function(result){
34                $(eShow).html(result);
35                /*if(id!=''){
36                    $('html, body').animate({
37                        scrollTop: $(id+id_post).offset().top
38                    }, 1000);
39                }*/
40            }
41        });
42    }
43}
44 
45
46
47function doEnter(event,obj){
48
49    if(event.keyCode == 13 || event.which == 13) onSearch(obj);
50}
51
52function onSearch(obj){           
53    var keyword = $("#"+obj).val();
54    
55    if(keyword==''){
56        modalNotify(LANG['no_keywords']);
57        return false;
58    }else{
59        location.href = "tim-kiem?keyword="+encodeURI(keyword);
60        loadPage(document.location);            
61    }
62}
63
64function goToByScroll(id){
65    var offsetMenu = 0;
66    id = id.replace("#", "");
67    if($(".menu").length) offsetMenu = $(".menu").height();
68    $('html,body').animate({
69        scrollTop: $("#" + id).offset().top - (offsetMenu * 2)
70    }, 'slow');
71}
72
73function update_cart(id=0,code='',quantity=1){
74    if(id){
75        var ship = $(".price-ship").val();
76
77        $.ajax({
78            type: "POST",
79            url: "ajax/ajax_cart.php",
80            dataType: 'json',
81            data: {cmd:'update-cart',id:id,code:code,quantity:quantity,ship:ship},
82            success: function(result){
83                if(result)
84                {
85                    $('.load-price-'+code).html(result.gia);
86                    $('.load-price-new-'+code).html(result.giamoi);
87                    $('.price-temp').val(result.temp);
88                    $('.load-price-temp').html(result.tempText);
89                    $('.price-total').val(result.total);
90                    $('.load-price-total').html(result.totalText);
91                }
92            }
93        });
94    }
95}
96
97function load_district(id=0){
98    $.ajax({
99        type: 'post',
100        url: 'ajax/ajax_district.php',
101        data: {id_city:id},
102        success: function(result){
103            $(".select-district").html(result);
104            $(".select-wards").html('<option value="">'+LANG['wards']+'</option>');
105        }
106    });
107}
108
109function load_wards(id=0){
110    $.ajax({
111        type: 'post',
112        url: 'ajax/ajax_wards.php',
113        data: {id_district:id},
114        success: function(result){
115            $(".select-wards").html(result);
116        }
117    });
118}
119
120function load_ship(id=0){
121    if(SHIP_CART){
122        $.ajax({
123            type: "POST",
124            url: "ajax/ajax_cart.php",
125            dataType: 'json',
126            data: {cmd:'ship-cart',id:id},
127            success: function(result){
128                if(result)
129                {
130                    $('.load-price-ship').html(result.shipText);
131                    $('.load-price-total').html(result.totalText);
132                    $('.price-ship').val(result.ship);
133                    $('.price-total').val(result.total);
134                }   
135            }
136        }); 
137    }
138}

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.