PageSourceSearch

https://mastermaverick.com.br/wp-content/themes/newscrunch/assets/js/product-ajax-search.js

js mastermaverick.com.br collected 2026-09-26 18:11:15 UTC 1,413 bytes, 36 lines download raw bytes

1// AJAX Product live search functionality
2jQuery(document).ready(function($) {
3    
4    $('#product-search-input').on('input', function () {
5        let search = $(this).val().trim();
6        let category = $('#selected-product-cat').val();
7
8        if (search.length > 0) {
9            $.ajax({
10                url: newscrunch_ajax.ajax_url,
11                type: 'POST',
12                data: {
13                    action: 'newscrunch_live_product_search',
14                    keyword: search,
15                    category: category
16                },
17                beforeSend: function () {
18                    $('.product-search-results-container').show();
19                    $('.product-search-results-container').html('<div class="searching-text">' + newscrunch_ajax.searching_text + '</div>');
20                },
21                success: function (response) {
22                    $('.product-search-results-container').html(response);
23                },
24                error: function() {
25                    $('.product-search-results-container').empty();
26                }
27            });
28        } else {
29            // Clear and hide results when input is empty
30            $('.product-search-results-container').empty().hide();
31        }
32    });
33
34    // Ensure container is hidden by default when page loads
35    $('.product-search-results-container').hide();
36});

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.