PageSourceSearch

https://rockin247radio.com/wp-content/themes/onix_theme/assets/js/ajax-search.js

js rockin247radio.com collected 2026-10-05 18:11:28 UTC 1,361 bytes, 49 lines download raw bytes

1jQuery(document).ready(function ($) {
2  let $mainBox = $('.content');
3
4  $(".theme-ajax-search-form").submit(function (e) {
5    e.preventDefault();
6
7    let queryString = $(this).serialize() + "&action=ajax_theme_search";
8    let string = $(this).find('input.search_string').val();
9
10    $.ajax({
11      type: "POST",
12      url: ajaxscript.ajax_url,
13      data: queryString,
14      beforeSend: function (xhr) {
15        $mainBox.animate({opacity: 0.5}, 300);
16      },
17      error: function (error) {
18        console.log('error:')
19        console.log(error)
20      },
21      success: function (response) {
22        $mainBox.html(response);
23        $('.pagination > span').click(processPagination);
24        updateSearchUrl(string)
25      },
26      complete: function (rsp) {
27        $mainBox.animate({opacity: 1}, 300);
28      }
29    });
30  });
31});
32
33/**
34 * function to replace url with ? text parameter. remove /page/number page from url
35 */
36function updateSearchUrl(string){
37  let currentUrl = window.location.href;
38  let url = new URL(currentUrl);
39  url.searchParams.set("text", string);
40  let newUrl = url.href;
41
42  //find in url already existing page
43  let re = RegExp("^.*/page/[0-9]+/");
44  let pageNumberIsset = re.test(newUrl);
45  if (pageNumberIsset) {
46    newUrl = newUrl.replace(/\/page\/[0-9]+/g, '');
47  }
48  window.history.pushState(null, document.title, newUrl);
49}

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.