PageSourceSearch

https://www.experimonkey.com/php/min.js.php?0=ajax&1=popup&2=give_nana&3=reaction_button&4=tooltips

js experimonkey.com collected 2026-10-02 13:11:54 UTC 3,163 bytes, 100 lines download raw bytes

1
2function ajax(url, id) {
3  document.getElementById(id).innerHTML = '<img src="/img/global/spinner.gif" width="15">';
4  var xhr = new XMLHttpRequest();
5  
6  // Add error handling
7  xhr.onerror = function() {
8    console.error("An error occurred while attempting to make the AJAX request.");
9  };
10  
11  // Add a timeout
12  xhr.timeout = 5000; // 5 seconds
13  xhr.ontimeout = function() {
14    console.error("The AJAX request timed out.");
15  };
16  
17  xhr.onreadystatechange = function() {
18    if (this.readyState == 4) {
19      if (this.status == 200) {
20        // Update the HTML of the element with the given id
21        document.getElementById(id).outerHTML = this.responseText;
22      } else {
23        // Handle non-200 status codes
24        console.error("The AJAX request returned a non-200 status code:" + this.status);
25      }
26    }
27  };
28  xhr.open("POST", url, true);
29  xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
30  
31  // Convert the form element values to a query string
32  var queryString = "";
33  for (var i = 2; i < arguments.length; i++) {
34    if (i > 2) {
35      queryString += "&";
36    }
37    var element = document.getElementById(arguments[i]) || document.getElementsByName(arguments[i])[0];
38    queryString += arguments[i] + "=" + encodeURIComponent(element.value);
39  }
40  
41  xhr.send(queryString);
42}
43
44function show(id) {  
45  var element = document.getElementById(id);
46  if (element) {
47    if (element.classList.contains('hidden')) {
48      element.classList.remove('hidden');
49    } else {
50      element.classList.add('hidden');
51    }
52  }
53}
54
55function give_nana(id) {
56  var xhttp;
57  if(window.XMLHttpRequest)  //New browsers
58    xhttp = new XMLHttpRequest();
59  else  //Old browsers
60    xhttp = new ActiveXObject("Microsoft.XMLHTTP");
61   xhttp.onreadystatechange = function() {
62    if(this.readyState == 4 && this.status == 200) {
63      var box = document.getElementById(id + "-nana");
64      box.innerHTML = this.responseText;
65    }
66  }
67  xhttp.open("POST", "/php/give_nana.php", true);
68  xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
69  xhttp.send("id=" + id);
70}
71
72const reactionCheckBox = document.querySelectorAll('.btn-check');
73reactionCheckBox.forEach(checkBox => {
74  checkBox.addEventListener('click', () => {
75    const span = checkBox.nextElementSibling.querySelector('span');
76    let count = parseInt(span.textContent);
77    if (checkBox.checked) {
78      count++;
79    } else {
80      count--;
81    }
82    span.textContent = count;
83
84    const id = checkBox.id;
85    const value = checkBox.value;
86    const isChecked = checkBox.checked;
87    const xhr = new XMLHttpRequest();
88    xhr.open('POST', '/php/reaction_button.php', true);
89    xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
90    xhr.onload = function() {
91      if (this.status == 200) {
92        console.log(this.responseText);
93      }
94    }
95    xhr.send(`id=${id}&type=fact&value=${value}&isChecked=${isChecked}`);
96  });
97});
98
99const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
100const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))

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.