PageSourceSearch

https://www.sun.ac.jp/assets/js/ajax_news.js

js sun.ac.jp collected 2026-10-01 12:02:37 UTC 1,991 bytes, 64 lines download raw bytes

1
2let jsParams = {
3  cate:'all',
4  max_page: 5,
5  content:'top',
6  type:'all',
7  template: 'news_list_cate',
8  target_tab: '.js_tab_news',
9  target_list: 'js_news_list',
10  target_pager: 'js_news_pager',
11  detailsPath: './news/',
12  page: 1,
13};
14async function updateView(jsParams) {
15    // データの再取得 ---
16    await getResultData(jsParams);
17}
18/*
19データ取得関数
20*/
21let fetchedData = '';
22async function getResultData($params) {
23  const currentUrl = new URL(window.location.href);
24
25  try {
26    // クエリパラメータ作成
27    const params = new URLSearchParams($params);
28   
29    const targetDivId = $params['target_list'];
30    const targetPager = $params['target_pager'];
31    const BtnDir = $params['detailsPath'];
32
33    // fetchでデータ取得
34    const response = await fetch(`/assets/mt_lib/ajax_execTopNews.php?${params.toString()}`);
35    //console.log(`/assets/mt_lib/ajax_execTopNews.php?${params.toString()}`);
36    if (!response.ok) throw new Error('データの取得に失敗しました');
37
38    fetchedData = await response.json();
39    // イベント発火(取得完了)
40    document.dispatchEvent(new CustomEvent('resultLoaded', {
41      detail: {
42        targetDivId,
43        targetPager,
44        BtnDir,
45      }
46    }));
47  } catch (error) {
48    console.error('エラー:', error);
49  }
50}
51// データ表示処理
52document.addEventListener("resultLoaded", (event) => {
53  const { targetDivId,targetPager,BtnDir } = event.detail;
54  const targetDiv = document.getElementById(targetDivId);
55  const pager = document.getElementById(targetPager);
56  const btn = document.getElementById('js_news_btn');
57  if (targetDiv) targetDiv.innerHTML = fetchedData.list;
58  if (pager) pager.innerHTML = fetchedData.pager;
59  if (btn) btn.href = BtnDir;
60
61  if (document.querySelector('.wrap_pagination') && pager.textContent === '') {
62    document.querySelector('.wrap_pagination').style.display = 'none';
63  }  
64});

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.