PageSourceSearch

https://www.happyneuron.fr/rsc/hn4/js/modern-modal.js?v=260401

js happyneuron.fr collected 2026-10-02 10:58:15 UTC 1,329 bytes, 38 lines download raw bytes

1function loadHnModernModal(url) {
2  new Ajax.Request(url, {
3    method: 'get',
4    parameters: { ajax: 'CONTENT' },
5    requestHeaders: { Accept: 'application/json' },
6    onSuccess: function (transport) {
7      document.fire('ajax:load');
8      const json = transport.responseText.evalJSON(true);
9      const body = document.querySelector('body');
10      // background
11      const hnModernModalBg = document.createElement('div');
12      hnModernModalBg.setAttribute('id', 'hnModernModalBg');
13      hnModernModalBg.className = 'hnModernModalBg';
14      hnModernModalBg.onclick = closeHnModernModal;
15      body.appendChild(hnModernModalBg);
16      // modal
17      const hnModernModal = document.createElement('div');
18      hnModernModal.setAttribute('id', 'hnModernModal');
19      hnModernModal.className = 'hnModernModal';
20      body.appendChild(hnModernModal);
21      // content
22      hnModernModal.innerHTML = json.CONTENT;
23      hnModernModal.style.display = 'block';
24    },
25  });
26}
27
28function closeHnModernModal() {
29  const body = document.querySelector('body');
30  const hnModernModalBg = document.querySelector('#hnModernModalBg');
31  const hnModernModal = document.querySelector('#hnModernModal');
32  if (hnModernModalBg) {
33    body.removeChild(hnModernModalBg);
34  }
35  if (hnModernModal) {
36    body.removeChild(hnModernModal);
37  }
38}

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.